lemnisk-react-native 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,7 @@ repositories {
56
56
  dependencies {
57
57
  //noinspection GradleDynamicVersion
58
58
  implementation "com.facebook.react:react-native:+" // From node_modules
59
- implementation 'co.lemnisk.app.android:AndroidSDK:1.1.40'
59
+ implementation 'co.lemnisk.app.android:AndroidSDK:1.1.46'
60
60
  implementation 'org.apache.commons:commons-text:1.9'
61
61
  //implementation(name:'AndroidSDK-release', ext:'aar')
62
62
  implementation group: 'joda-time', name: 'joda-time', version: '2.10.10'
@@ -20,6 +20,9 @@ import com.facebook.react.bridge.ReadableMapKeySetIterator;
20
20
 
21
21
  import co.lemnisk.app.android.AttributeBuilder;
22
22
  import co.lemnisk.app.android.LemniskHelper;
23
+ import co.lemnisk.app.android.Utils;
24
+ import co.lemnisk.app.android.LemConstants;
25
+ import android.text.TextUtils;
23
26
 
24
27
  @ReactModule(name = LemniskSdkModule.NAME)
25
28
  public class LemniskSdkModule extends ReactContextBaseJavaModule {
@@ -36,8 +39,12 @@ public class LemniskSdkModule extends ReactContextBaseJavaModule {
36
39
  @Override
37
40
  public void onSuccess(@NonNull String s) {
38
41
  Log.d("Firebase Token","onSuccess ========> : "+s);
39
- helper.setGCMToken(s);
42
+ String previousToken = Utils.getInstance(reactContext).getStringFromSharedPrefs(LemConstants.PREFS_GCM_TOKEN);
40
43
  helper.init();
44
+ if(!TextUtils.isEmpty(previousToken) && !s.equalsIgnoreCase(previousToken)){
45
+ Utils.getInstance(reactContext).setStringInSharedPrefs(LemConstants.PREFS_GCM_TOKEN, "");
46
+ helper.setGCMToken(s);
47
+ }
41
48
  }
42
49
  });
43
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemnisk-react-native",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "plugin to setup the lemnisk sdk on both android and ios platform",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",