Leanplum / Leanplum-ReactNative-SDK

Leanplum's integrated solution delivers meaningful engagement across messaging and the in-app experience.
https://www.leanplum.com/
Apache License 2.0
7 stars 8 forks source link

Android - No messages in In-App inbox #76

Closed uen closed 1 year ago

uen commented 1 year ago

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.json

In android/app/build.gradle I have tried:

implementation 'com.leanplum:leanplum-core:7.0.1'
// and also tried the latest leanplum-core
implementation 'com.leanplum:leanplum-core:7.1.0'
// and also tried it with & without clevertap dependency
implementation 'com.clevertap.android:clevertap-android-sdk:4.7.2'

In MainApplication.java I can confirm I have

        Leanplum.setApplicationContext(this);
        Parser.parseVariables(this);
        //  For session lifecyle tracking.
        LeanplumActivityHelper.enableLifecycleCallbacks(this);

I have tried setting the app ID & keys with both JS Leanplum.setAppIdForDevelopmentMode and also with the strings leanplum_app_id in strings.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?)

2023-02-21 21:31:55.638 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Cannot load string for key = leanplum_app_id. Message = String resource ID #0x0
2023-02-21 21:31:55.639 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Cannot load string for key = leanplum_prod_key. Message = String resource ID #0x0
2023-02-21 21:31:55.639 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Cannot load string for key = leanplum_dev_key. Message = String resource ID #0x0
2023-02-21 21:31:55.639 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Cannot load string for key = leanplum_environment. Message = String resource ID #0x0
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-1, -120, 75, 28, 66, -112, -105, -126, -37, -117, 67, 47, 90, 120, -62, 17]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[72, 67, 52, -71, 106, -51, 43, -54, -110, 46, 36, -114, -17, -37, 65, -88, -56, 88, 47, 83, -113, 111, 110, 101, 90, -101, -1, 81, -64, -97, -120, 112, 49, 16, 67, -70, -26, 75, -77, 97, 98, 66, -3, -41, 54, 16, 114, 2, 69, -46, -25, 61, 9, 99, -4, -16, 0, 122, -71, -89, 45, 97, -61, 104, -125, 17, -23, -19, 49, -27, 103, -116, 24, 43, 83, 42, 127, 105, -82, 31, -117, 123, 51, -62, -54, -74, 60, 30, 29, -75, -64, -90, 101, -28, -105, -92, -25, -67, 55, 81, 21, -107, -66, -62, -41, -123, -26, -99, -108, 31, 86, -78, -56, 80, -92, 90, -106, 34, 25, 2, 44, 45, 67, 115, 18, -23, 75, 61, 126, -46, 79, -121, -78, 40, -15, -3, -93, -43, -113, 106, -5, 63, -13, -91, -23, 96, -76, 68, 103, -116, -103, 22, -62, 38, -5, -95, 43, 33, -87, -62, 16, 45, 58, -14, -53, -85, 89, 53, 91, 87, -61, -27, 109, -24, -115, 92, -82, -8, 55, -90, 18, -17, -38, 23, 3, -12, 94, 82, -92, 15, -58, 30, -60, -95, 2, -44, -98, -91, -29, 59, -69, -69, -108, -28, 40, -60, -116, -70, 58, 127, -5, -43, 78, -57, 69, 85, 74, -26, -120, -58, 106, -96, -52, -58, 12, 36, 36, -41, 107, -37, 127, 46, 69, -25, -46, -82, 35, 95, 72, -95, 20, -39, 100, -15, 86, 53, 94, -31, -84, -33, 63, 119, -89, -23, 50, 65, -101, -119, 44, -51, -121, -118, 108, -105, -119, -86, 55, 59, 8, 57, 27, 101, 75, 80, -38, -34, -28, -95, 104, -24, 60, 12, 85, 11, 109, -54, 83, 7, 47, -66, -12, 48, -124, 54, 119, -100, 48, 41, 59, -37, 120, -3, -103, 82, -20, 84, -2, 80, -29, -72, -81, -71, 30, 102, -34, -38, 35, 57, 74, 78, 51, -63, -72, 58, -46, 13, 81, 76, -6, 89, 71, -105, -97, 123, 83, -40, 38, 31, 20, -7, -102, 36, -52, 62, 117, -76, -81, 96, -113, 124, 110, -11, 80, 110, 86, -7, -72, 31, -50, 41, 73, 108, -48, 59, 49, -100, -77, -124, -5, -121, -48, 93, -8, -16, -122, 47, -55, -25, -30, 119, -113, -39, -120, -125, -18, 38, 84, -104, -27, -50, -114, -28, 20, -72, -114, -22, -95, 66, -73, 48, 98, -104, 31, -11, -39, 82, 54, -47, 113, 76, -107, -37, -48, 118, 3, 55, 126, 40, 45, 67, 75, 91, 13, -114, 96, 95, 5, -101, 123, -66, -58, 11, -24, -91, 11, -34, 122, -5, 19, 76, 79, 101, -41, -67, 25, -81, -7, -86, 47, 91, -39, 75, 88, -109, -17, 82, -83, 36, 73, 49, -110, -34, -34, -109, -79, -37, -8, 5, -109, -113, 107, 110, -33, -70, 60, -2, 126, -92, 78, 55, -98, -98, 59, -42, -47, 116, -127, -19, -34, 38, 78, 33, -67, -83, 119, 33, 14, 56, 99, -1, -76, -25, -30, 111, -27, 108, 52, -35, 78, 39, -63, -32, 40, 3, -110, 20, 22, 62, -10, -73, -41, -116, -42, 50, 80, 96, 28, -27, -112, -46, -63, 114, 48, 17, -61, -42, -83, -80, -37, 65, -86, 45, -127, 101, -102, 47, -48, -62, -63, 36, 116, 63, 85, -36, -29, -63, -120, -84, -106, 45, 98, 12, -114, 51, 45, 107, 67, -35, -7, -84, -44, 84, -73, -93, -44, -85, -115, 15, 44, -122, 40, 51, -113, -33, -35, -48, 5, -30, -39, 92, 89, 33, 44, 100, 58, 49, -26, -96, -97, -7, -97, -59, 66, 83, -73, -28, -123, 34, 107, 54, -102, 53, -120, 33, 14, -56, -116, -25, 121, -126, 9, -95, -5, -21, 18, 53, -112, 95, -13, -16, -98, 92, -49, -99, 126, -29, 63, 123, -93, -112, -87, -76, 37, 79, -10, 79, 6, 125, 66, 84, -5, 66, -99, -63, -43, -29, -24, -20, -110, -84, -36, 5, -112, -10, -61, -3, -97, 97, -14, -51, -9, -6, -59, -119, 30, 35, 102, 73, 81, -37, 23, 39, 112, -78, -121, 86, -17, 48, -40, -119, -87, -70, -61, 95, -99, -12, 19, 45, 41, -125, -35, -116, -57, -106, -21, -7, -51, 77, 120, 91, -118, 75, -122, 122, -74, 57, 57, -100, 57, 7, -81, -2, -28, -54, 119, -47, -78, 62, -106, 14, 54, 35, 18, -57, 5, 121, 84, 35, 123, 80, -77, -51, 99, -124, 14, 96, -64, 56, -62, -32, 60, 116, -114, 65, -13, 54, -56, 55, 87, -97, 35, -1, -7, -69, 65, 57, 73, 94, 35, 45, -34, -86, 19, -27, -56, -77, 62, -46, -33, 94, -113, 89, -70, -23, -5, 73, 55, 45, -8, 1, 43, -79, -48, 75, 28, -87, -50, -115, 122, 65, -57, -46, 100, 116, -117, 102, -127, -62, -119, 95, -49, -65, 52, 23, -32, 78, 36, -8, -124, 111, 94, -62, 1, -91, -105, -63, -18, 5, -65, -119, 39, 126, 33, -2, 9, -64, 14, 83, -61, -10, 96, -41, -15, -31, -14, 44, -16, -25, -86, 94, -78, -114, 125, 23, -72, -6
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: 8, 61, -33, 126, -113, 13, -62, -68, -46, 92, 124, 28, 110, -107, -106, 11, 76, 111, -66, -3, 16, -93, 61, 99, -113, -44, 112, -31, -77, 46, -3, -120, -121, 123, 67, -101, -26, -55, -59, 84, 53, -21, 35, -60, -33, 89, -23, 30, 26, -28, 106, -39, 122, -76, -24, -34, 94, -74, -118, 93, -18, 99, 56, -19, -72, -113, -28, 28, 24, -9, -8, 36, -53, 18, -77, -94, 57, 75, -102, -48, -97, 64, -39, -58, 8, -114, -66, -63, 1, 24, 75, 91, -75, 33, -67, 57, 42, -60, 18, 6, 24, -20, -20, -44, -109, -111, 26, 115, -11, -49, -48, 52, 80, 25, 121, 51, -30, -103, -36, -42, -14, -82, 5, -77, 66, 123, 114, -43, 5, 57, 101, -32, 7, 51, 121, 112, -112, -43, 37, -11, -10, 80, 107, 0, 70, -58, -102, 62, 22, -85, 16, -74, 2, 86, 120, -9, 57, -113, -65, -57, 127, -65, -33, -23, 21, -95, -48, -18, -3, 52, 87, 65, -65, 103, 110, 97, 20, -46, 80, -55, 7, -26, -59, -25, -101, 78, -46, -62, 72, 113, 15, 106, 115, 73, -6, -105, -110, -86, 19, 56, -118, -92, 119, 93, -114, -85, -111, -89, -32, 100, 19, 56, 67, -16, -7, 11, -14, 56, 31, 53, 119, 37, 102, -49, 117, -7, -79, -50, -67, -35, 22, -42, -31, -15, 76, -30, 55, -90, 43, 33, -12, -5, 93, -64, 11, 73, -12, 75, -20, -68, -111, 79, 23, -3, -124, -108, 40, -8, 69, -102, -84, -26, 13, -39, 86, 26, 67, -46, -22, -55, 5, 85, 96, -11, -59, -128, -80, -38, 77, -59, -88, -73, -22, 5, 57, -119, -123, 7, -83, 80, 87, -57, 4, 34, -56, 27, -111, -23, -14, 91, -34, 34, -55, -55, -53, -84, -14, 4, 91, -24, -2, 99, -9, -13, -119, 67, 37, 9, -65, 112, -12, -114, -7, -72, -98, 103, -114, 39, -113, 3, -98, 24, 94, 44, -79, -76, -20, 40, -51, 86, 70, -111, 28, 81, -20, 63, 46, 88, 76, -92, -56, -23, -30, -74, 107, 26, 9, -70, 124, 35, -75, -126, -42, -104, -49, -19, -46, 78, 25, -72, -120, -82, 94, 105, -96, -47, -13, -42, 24, -108, 85, 7, -38, -27, -67, 91, 92, -123, 93, 65, -12, -83, -84, 55, 31, 60, -31, 117, 103, -99, -54, -35, 100, 121, -109, -76, -120, 6, 100, 16, -97, 117, -128, -93, 105, -48, -65, -39, 8, 73, -88, -41, 65, 98, -26, -85, 102, 124, -38, -21, -35, -85, -106, 49, 1, -63, -88, -82, -39, 40, 88, 65, -10, -84, -37, -49, 36, -7, -96, 56, 87, 44, -108, -42, -11, -58, 64, 78, 7, -82, 31, -76, -38, -33, -53, -17, -66, -55, -3, 99, 1, -127, 107, -64, -117, 3, -26, 96, 107, -11, -111, -52, -89, 104, 14, -7, 6, 76, 61, 110, 8, 121, 51, -34, 67, -117, 93, 106, 11, 127, -96, 27, 78, -38, -46, 22, -76, -12, 62, -81, 90, -76, 4, 27, -42, -21, 84, 44, 10, 38, 12, 124, -57, -57, 78, -63, -88, -80, 39, -124, -59, -4, -87, 4, -29, 42, 125, -59, -73, 110, -16, -109, 61, 113, -7, 12, -120, 88, 43, -59, 96, -106, 114, -72, 92, -33, -51, -76, 52, 85, 42, 112, -85, 122, 90, 69, -18, -87, 26, -111, -3, -48, -48, 109, 56, 90, 105, -58, 101, 92, -76, 13, -30, -60, 53, -78, 5, 21, -49, -90, -48, -68, -73, -62, 82, 13, -89, 29, 77, -33, -45, 100, -5, -49, -98, 30, -115, -22, -89, 91, 56, 15, -78, 115, -96, 29, 45, 73, 37, 27, 82, -67, 122, -11, 27, -127, -32, -110, -78, 78, 99, -121, 54, -88, 106, 49, 84, 61, -37, -54, 14, -55, 29, -37, -109, -93, 79, -115, 72, 103, -125, -1, 1, 12, 61, 39, -61, 37, 105, 12, 99, -95, 122, -108, -56, 55, 117, 3, -58, -80, -72, 28, 109, 20, -87, -17, -8, 94, -23, -30, -2, -48, 21, -83, -96, -92, 2, 99, -48, 7, -93, -98, -46, -42, -93, -113, -44, 1, 121, 70, -43, 121, 47, -50, 55, -8, 67, -99, -75, 36, -99, 94, 70, -60, -52, 45, -92, 104, -24, -87, -54, -101, -79, -79, 86, -5, 12, -94, -112, 51, -67, 27, -89, 49, -87, 86, -127, 92, -89, -47, 51, 18, 83, -82, -40, -12, -122, 79, 62, 35, -8, -67, -106, 0, 102, 95, 21, -18, -43, 93, -91, 46, -26, 103, 35, 74, 34, 50, -111, -43, -58, 63, -41, 32, 41, 50, 56, 75, 23, 47, 95, -17, 44, 89, -114, 15, 20, 117, -52, 75, 99, 64, -33, -67, -23, -14, 38, 33, 100, 49, 18, -12, 51, -99, 80, -120, -7, 118, -53, -116, -46, 48, -89, -97, -13, -67, -7, 74, 19, -5, 100, -26, -111, 121, 93, -82, 9, 115, 88, 93, 81, 11, -43, -69, 122, -101, -126, -64, -126, 34, 113, -100, 113, 64, 4, -25, 48, 102, -62, 18, 0, 3, 111, 28, -8, 49, 43, 79, 5, -123, 88, 90, -17, -126, -70, 13,
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]:  -128, -37, -52, 58, 5, -87, -43, -111, -95, -2, 6, 114, -75, -36, 48, -52, 69, 107, -25, -62, -100, 35, 33, -77, 11, 108, -1, 97, 14, 55, 59, -62, 17, -4, -67, 68, -117, -114, 91, -98, -105, -64, 48, 87, 26, 91, 78, -103, 87, 106, 69, 42, -27, -82, 78, 67, 21, 43, -55, -26, 98, 90, -114, -115, 111, 8, -72, 5, 83, 44, -6, -127, 65, 102, -121, -37, 102, -127, 114, 93, 0, 78, 69, 105, 18, -112, -12, -60, 84, -120, -45, -71, 47, -63, -57, 65, 10, -33, 53, 97, -19, -17, -123, 74, 127, 26, -38, 101, -4, 104, 127, 35, 123, 26, -61, -72, -100, 94, 14, 89, 26, 61, 110, 70, -99, 83, 118, -48, -21, -19, 6, -121, -40, 100, 4, -45, -55, 33, 7, 120, -35, 33, 76, -6, 120, -66, -68, 39, -119, 123, 38]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-1, -120, 75, 28, 66, -112, -105, -126, -37, -117, 67, 47, 90, 120, -62, 17]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[46, -82, 31, -117, 107, 93, -52, -88, 30, -26, 28, -90, -46, -108, 78, 49]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-1, -120, 75, 28, 66, -112, -105, -126, -37, -117, 67, 47, 90, 120, -62, 17]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-1, -120, 75, 28, 66, -112, -105, -126, -37, -117, 67, 47, 90, 120, -62, 17]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[105, -61, 86, 27, -115, 49, -68, -112, -20, -43, 53, -16, 3, 11, -1, -78]
2023-02-21 21:31:55.645 21268-21405/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-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-37, -69, 37, 47, 55, 72, -118, 58, 29, 92, 111, 40, -76, 90, -60, -73, 26, -124, 29, -56, 32, -81, 4, -121, 34, -23, 124, 40, 23, -33, -114, 79]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[7, 95, -81, -61, 72, -121, 44, 63, -63, -104, -30, 89, -85, -40, 93, 5, -63, 0, -82, -112, 16, 62, 10, 18, 10, 101, -104, 66, 64, 4, 20, 117, 71, -69, 49, 55, -25, 53, 69, 23, 40, -119, -39, 89, 34, 126, -111, 105]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-50, 112, 0, 36, 21, 22, 80, 8, 76, 96, 6, -24, -125, 3, -93, 119]
2023-02-21 21:31:55.645 21268-21405/com.removed.debug E/[Leanplum][ERROR]: Decrypt called with null appId.
2023-02-21 21:31:55.645 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Unable to decrypt 01[-1, -120, 75, 28, 66, -112, -105, -126, -37, -117, 67, 47, 90, 120, -62, 17]
2023-02-21 21:31:55.651 21268-21405/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-21 21:31:55.653 21268-21463/com.removed.debug D/[Leanplum][DEBUG]: Trying to start LeanplumPushService
2023-02-21 21:31:55.656 21268-21463/com.removed.debug I/[Leanplum][INFO]: MiPush module not found. For Mi Push messaging include dependency "com.leanplum:leanplum-mipush".
2023-02-21 21:31:55.659 21268-21463/com.removed.debug D/[Leanplum][DEBUG]: Using deviceID for mode: MD5_MAC_ADDRESS
2023-02-21 21:31:55.659 21268-21463/com.removed.debug D/[Leanplum][DEBUG]: Using Android device id: 5d2caea84106f38f
2023-02-21 21:31:55.659 21268-21463/com.removed.debug D/[Leanplum][DEBUG]: Using Android device id: 5d2caea84106f38f
2023-02-21 21:31:55.660 21268-21463/com.removed.debug D/[Leanplum][DEBUG]: setting deviceID as userID
2023-02-21 21:31:55.660 21268-21463/com.removed.debug D/[Leanplum][DEBUG]: Will call API method: start with params: {country=(detect), newsfeedMessages=[], gcmRegistrationId=removed: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-21 21:31:55.666 21268-21268/com.removed.debug I/[Leanplum][INFO]: Registering for FCM push notifications with ID dremoved
2023-02-21 21:31:55.667 21268-21268/com.removed.debug D/[Leanplum][DEBUG]: Will call API method: setUserAttributes with params: {newUserId=928B0C258B4F463AA3B7E6517C4FA0AA, userId=null}
2023-02-21 21:31:56.107 21268-21463/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":"notification"},"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":"d7de373c-f354-462f-b72a-9185be76da9c"}
2023-02-21 21:32:24.857 21268-21405/com.removed.debug D/[Leanplum][DEBUG]: Will call API method: resumeState with params: null
2023-02-21 21:32:24.862 21268-21404/com.removed.debug I/ReactNativeJS: 'Response from Leanplum.inbox()', { unreadMessages: [],
      unreadCount: 0,
      messagesIds: [],
      allMessages: [],
      count: 0 }

And this is the output with the keys set in strings.xml

2023-02-21 21:34:43.616 21887-21887/com.removed.debug D/[Leanplum][DEBUG]: [ActionManager] isPaused: false
2023-02-21 21:34:43.617 21887-21887/com.removed.debug D/[Leanplum][DEBUG]: [ActionManager]: performing all available actions: []
2023-02-21 21:34:50.652 21887-22024/com.removed.debug I/[Leanplum][INFO]: Using appId and accessKey from Android resources for production environment.
2023-02-21 21:34:50.678 21887-22024/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-21 21:34:50.690 21887-22024/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-21 21:34:50.691 21887-22083/com.removed.debug D/[Leanplum][DEBUG]: Trying to start LeanplumPushService
2023-02-21 21:34:50.693 21887-22083/com.removed.debug I/[Leanplum][INFO]: MiPush module not found. For Mi Push messaging include dependency "com.leanplum:leanplum-mipush".
2023-02-21 21:34:50.694 21887-22083/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-21 21:34:50.707 21887-21887/com.removed.debug D/[Leanplum][DEBUG]: Will call API method: setUserAttributes with params: {newUserId=928B0C258B4F463AA3B7E6517C4FA0AA, userId=928B0C258B4F463AA3B7E6517C4FA0AA}
2023-02-21 21:34:50.708 21887-21887/com.removed.debug I/[Leanplum][INFO]: Registering for FCM push notifications with ID removed
2023-02-21 21:34:51.118 21887-22084/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":"74750ad1-c664-4dca-a233-779bc7163f58"}
2023-02-21 21:35:13.034 21887-22024/com.removed.debug D/[Leanplum][DEBUG]: Will call API method: resumeState with params: null
2023-02-21 21:35:13.038 21887-22023/com.removed.debug I/ReactNativeJS: 'Response from Leanplum.inbox()', { unreadMessages: [],
      unreadCount: 0,
      messagesIds: [],
      allMessages: [],
      count: 0 }

If I call Leanplum.forceContentUpdate(); I get:

Will call API method: getVars with params: {newsfeedMessages=[], includeDefaults=false, includeVariantDebugInfo=false}

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

hborisoff commented 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?

uen commented 1 year ago

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

uen commented 1 year ago

I can double-confirm the same JS code and userId works with iOS and returns messages

hborisoff commented 1 year ago

@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

uen commented 1 year ago

@hborisoff Can you share your sample apps so I can try with my keys & user id?

hborisoff commented 1 year ago

@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.

uen commented 1 year ago

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