Closed uen closed 1 year ago
Hi @uen,
I see that there is probably a misconfiguration in your application. You must set your appId and prod/dev key before the Leanplum.start is called, using Leanplum.setAppIdForDevelopmentMode or Leanplum.setAppIdForProductionMode, that is the reason you see the errors when decrypting the cache.
Also when you use Leanplum RN SDK we suggest to stick with the versions, that it comes with, and not change them manually. In RN 2.0.0 we use Leanplum SDK 7.0.1 and CleverTap SDK 4.6.6. We are in the process of updating the RN SDK with the newer dependencies.
I will try to reproduce your issue on our end, but meanwhile can you try to fix my comments and test again?
Hi @hborisoff
I was trying other versions to see if it would start working :) I've made sure I'm on RN 2.0.0, Leanplum SDK 7.0.1 and CleverTap 4.6.6.
I was indeed calling start() before Leanplum.setAppIdForProductionMode() sometimes - but after fixing that issue the empty notifications on Android only remain.
I added logs to all the calls to Leanplum in my application, this is the output:
2023-02-22 11:06:07.626 11590-11590/com.removed.debug I/[Leanplum][INFO]: MiPush module not found. For Mi Push messaging include dependency "com.leanplum:leanplum-mipush".
2023-02-22 11:06:07.794 11590-11590/com.removed.debug D/[Leanplum][DEBUG]: [ActionManager] isPaused: false
2023-02-22 11:06:07.795 11590-11590/com.removed.debug D/[Leanplum][DEBUG]: [ActionManager]: performing all available actions: []
2023-02-22 11:06:15.183 11590-11728/com.removed.debug I/ReactNativeJS: Leanplum.setappIdForProductionMode()
2023-02-22 11:06:15.197 11590-11728/com.removed.debug I/ReactNativeJS: Leanplum start();
2023-02-22 11:06:15.216 11590-11729/com.removed.debug I/[Leanplum][INFO]: Geofencing support requires leanplum-location module and Google Play Services v8.1 and higher.
Add this to your build.gradle file:
implementation 'com.google.android.gms:play-services-location:8.3.0+'
implementation 'com.leanplum:leanplum-location:+'
2023-02-22 11:06:15.226 11590-11729/com.removed.debug I/[Leanplum][INFO]: LeanplumExceptionHandler could not initialize Exception Reporting.This is expected if you have not included the leanplum-monitoring module
2023-02-22 11:06:15.231 11590-11788/com.removed.debug D/[Leanplum][DEBUG]: Trying to start LeanplumPushService
2023-02-22 11:06:15.232 11590-11788/com.removed.debug D/[Leanplum][DEBUG]: Will call API method: start with params: {country=(detect), newsfeedMessages=[], gcmRegistrationId=removed, includeDefaults=false, city=(detect), timezone=Europe/London, versionName=3.70.0, locale=en_US, deviceName=Android Emulator, systemVersion=13, systemName=Android OS, timezoneOffsetSeconds=0, deviceModel=Android Emulator, location=(detect), region=(detect), includeVariantDebugInfo=false}
2023-02-22 11:06:15.233 11590-11590/com.removed.debug I/[Leanplum][INFO]: Registering for FCM push notifications with ID removed
2023-02-22 11:06:15.584 11590-11789/com.removed.debug D/[Leanplum][DEBUG]: Received start response: {"regions":{},"success":true,"defaultNotificationChannel":"removed_PUSH_NOTIFICATION_CHANNEL","messages":{"6119199164923904":{"countdown":0,"action":"Alert","parentCampaignId":6103083306778624,"vars":{"Message":"oooo","__name__":"Alert","Title":"removed."},"hasImpressionCriteria":false,"priority":1,"whenLimits":{"children":[{"subject":"times","objects":[],"verb":"limitSession","noun":"1"}],"objects":[],"verb":"AND"}},"4682614846324736":{"countdown":0,"action":"HTML","parentCampaignId":5068554265755648,"vars":{"Track URL":"http:\/\/leanplum\/track","Track Action URL":"http:\/\/leanplum\/runTrackedAction","HTML Align":"Top","HTML Height":60,"__name__":"HTML","Open URL":"http:\/\/leanplum\/loadFinished","__file__Template":"lp_public_banner-13.html","Action URL":"http:\/\/leanplum\/runAction","Font":{"__file__CSS File":"lp_public_sf_ui_font.css"},"Close URL":"http:\/\/leanplum\/close"},"hasImpressionCriteria":false,"priority":1,"whenLimits":{"children":[{"subject":"times","objects":[],"verb":"limitSession","noun":"1"}],"objects":[],"verb":"AND"}},"5753799885520896":{"countdown":0,"action":"Confirm","parentCampaignId":4990640434249728,"vars":{"__name__":"Confirm"},"hasImpressionCriteria":false,"priority":1000,"whenLimits":{"children":[{"subject":"times","objects":[],"verb":"limitSession","noun":"1"}],"objects":[],"verb":"AND"}},"4777291805163520":{"countdown":0,"action":"Confirm","parentCampaignId":4580283626618880,"vars":{"__name__":"Confirm","Title":"sdfsdfds"},"hasImpressionCriteria":false,"priority":1000,"whenLimits":{"children":[{"subject":"times","objects":[],"verb":"limitSession","noun":"1"}],"objects":[],"verb":"AND"}}},"notificationChannels":[{"importance":3,"name":"Default removed Push Channel","id":"removed_PUSH_NOTIFICATION_CHANNEL"}],"vars":{},"variants":[],"syncNewsfeed":false,"localCaps":[],"token":"removed","reqId":"b5545f07-58ee-4d84-81dc-59504de86929"}
2023-02-22 11:06:23.369 11590-11728/com.removed.debug I/ReactNativeJS: 'LeanplumInbox.inbox() response', { unreadMessages: [],
unreadCount: 0,
messagesIds: [],
allMessages: [],
count: 0 }
Let me know if you can replicate this, thanks
I can double-confirm the same JS code and userId works with iOS and returns messages
@uen The issue doesn't seem directly related to the Leanplum RN SDK, because our sample apps are receiving the inbox messages. Could you contact our support team at support@leanplum.com? Thank you
@hborisoff Can you share your sample apps so I can try with my keys & user id?
@uen
I'm sending you a zip with our sample project.
In the file /src/utils/startup.ts
you need to replace your keys in the 'TODO'
places, then run the project and go to Inbox tab.
Thanks for sending that over! Previously I had
implementation 'com.leanplum:leanplum-core:7.0.1'
and I replaced it with
// build.gradle
implementation project(':@leanplum_react-native-sdk')
// settings.gradle
include ':@leanplum_react-native-sdk'
project(':@leanplum_react-native-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/@leanplum/react-native-sdk/android')
and it worked
After upgrading from RN 0.64.2 with
@leanplum/react-native-sdk@1.2.1
to RN 0.70.6 with@leanplum/react-native-sdk/2.0.0
Android users always have an empty in-app inbox returned. iOS works fine with the exact same JS code with the same user ID.To upgrade, I added
"clevertap-react-native": "^0.9.4"
and"@leanplum/react-native-sdk": "^2.0.0"
to package.jsonIn
android/app/build.gradle
I have tried:In
MainApplication.java
I can confirm I haveI have tried setting the app ID & keys with both JS
Leanplum.setAppIdForDevelopmentMode
and also with the stringsleanplum_app_id
instrings.xml
. I've tried both production & dev modes.Finally, I used
Leanplum.setLogLevel(com.leanplum.internal.Log.Level.DEBUG);
to further debug.This is the output with the keys set in JS with
Leanplum.setAppIdForDevelopmentMode
(errors may be expected?)And this is the output with the keys set in
strings.xml
If I call
Leanplum.forceContentUpdate();
I get:Again, iOS seems to work fine with the same code so I'd appreciate any ideas on what I'm doing wrong / if it is an issue with Leanplum
Thanks