question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] : Preferences Not Available to Plugins

See original GitHub issue

I have been attempting to use the cordova-plugin-code-push alongside tabris-android. Unfortunately the “codepushdeploymentkey” preference along with other preferences are not being parsed/passed to the plugin during initialization. The debug logging statements below demonstrate what is happening:

09-11 05:17:38.153  6517  6517 D logging preferences parsed: {loglevel=DEBUG, codepushdeploymentkey=lhZoVI0z5UWn3GKr6O2_ROTUy-wYVyFgmvTob} 

09-11 05:17:38.450  6517  6517 D logging preferences passed to appView.init: {loglevel=DEBUG, codepushdeploymentkey=lhZoVI0z5UWn3GKr6O2_ROTUy-wYVyFgmvTob}

09-11 05:17:38.450  6517  6517 D logging preferences received in CordovaWebViewImpl.init: {loglevel=DEBUG, codepushdeploymentkey=lhZoVI0z5UWn3GKr6O2_ROTUy-wYVyFgmvTob}

09-11 05:17:39.010  6517  6517 D logging preferences received in to TabrisWebView.init: {}

09-11 05:17:39.010  6517  6517 D logging preferences received in CordovaWebViewImpl.init: {}

My assumption is that the TabrisActivity.java, which I don’t have access to, is not parsing and passing the preferences to plugins that are being initialized. I would appreciate any advice you can give me regarding this, if you are unable to make the preferences available to plugins in a pr.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cookiegurucommented, Sep 11, 2016

@509dave16 You are absolutely correct; Tabris.js is not a hosting platform. However, assuming you are able to provide the hosting, I believe Tabris.js’ built-in functionality can solve all the other scenarios.

To give an implementation example, you might store a version number inside the app, for example 1.0.1. Upon launch, the app can fetch a remote document to determine the most up-to-date version of the code. If the client has a copy that is older than what that document specifies, then it would call the installPatch method. This would actually be a lot faster than CodePush’s methodolgy of running a diff on every single file in your app. Additionally it provides extra functionality in that you could theoretically patch one of your JavaScript dependencies in node_modules.

For more background on patching in Tabris.js check out this blog post.

0reactions
509dave16commented, Sep 11, 2016

@cookieguru Thanks for the example! I was starting to think along those same lines. I will have to explore Tabris.js patching some more. Appreciate the time you took today to address my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

a problem when using shared preference's plugin
I'm working on flutter and I've a problem with Shared preference plugin this is my code: import 'package:flutter/material.dart'; ...
Read more >
[BUG] Shared Preference plugin not working for headless task
After doing a lot of research, I found the answer. Add this to your code before you use shared preferences. SharedPreferences.
Read more >
SharedPreferences - Android Developers
For any particular set of preferences, there is a single instance of this class that all clients share. Modifications to the preferences must...
Read more >
Get the Android Studio Azure DevOps Services plug-in
In this article · In Android Studio, open plugin settings: · Click the Browse repositories... · Click the Install plugin button and restart...
Read more >
shared_preferences | Flutter Package - Pub.dev
Shared preferences plugin #. pub package. Wraps platform-specific persistent storage for simple data (NSUserDefaults on iOS and macOS, SharedPreferences on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found