Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onNotification does not run in the background (Android) #1930

Closed
stephanoparaskeva opened this issue Mar 31, 2021 · 12 comments
Closed

onNotification does not run in the background (Android) #1930

stephanoparaskeva opened this issue Mar 31, 2021 · 12 comments

Comments

@stephanoparaskeva
Copy link

stephanoparaskeva commented Mar 31, 2021

I am sending a background data notification via Postman and the onNotification function does not run on android when the application is in the background. But it does run when the application is in the foreground.

I am sending the notification with a channel_id

Here is the the notification:

{
 "to" : "fMkanXKjQlapi-Tf8Or8FA:APA91bFV6iIDNK7UJMrug75SpIvrpAE2jnuhnmQtBqJGlEyvr6dDeQljbBt_vySs-ii6Bd5ygtwwobUjRLstIJTM-9H-m-imvJHGR2tlyklcxA53OsMUkqFvAIDHPlVZkkVvA_JS7ySC",
 "data" : {
     "initiatorId" : "127167807"
 },
  "priority": "high",
  "android_channel_id": "QB_PUSH_NOTIFICATION_CHANNEL"
}

Here are the LOGCAT logs.

2021-03-31 10:34:25.365 31065-31344/com.euclid V/RNPushNotification: onMessageReceived: Bundle[{data=Bundle[{initiatorId=127167807}]}]
2021-03-31 10:34:25.372 31065-31065/com.euclid V/RNPushNotification: sendNotification: Bundle[{userInteraction=false, id=-1674574242, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 10:34:25.374 31065-31065/com.euclid D/RNPushNotification: Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: Bundle[{userInteraction=false, id=-1674574242, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 10:35:25.618 31065-31383/com.euclid V/RNPushNotification: onMessageReceived: Bundle[{data=Bundle[{initiatorId=127167807}]}]
2021-03-31 10:35:25.628 31065-31065/com.euclid V/RNPushNotification: sendNotification: Bundle[{userInteraction=false, id=-187201450, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 10:35:25.632 31065-31065/com.euclid D/RNPushNotification: Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: Bundle[{userInteraction=false, id=-187201450, data=Bundle[{initiatorId=127167807}], foreground=false}]

Here is the androidManifest.xml
https://pastebin.com/iHFkb06K

My .configure() function is called outside of any component inside index.js

const onRegister = ({ token }: TDeviceInfo) => AsyncStorage.setItem(FCM_OR_APNS_TOKEN, token);

PushNotification.configure({
  onRegister,
  onNotification,
  popInitialNotification: true,
  requestPermissions: true,
});

PushNotification.createChannel(
  {
    channelId: 'QB_PUSH_NOTIFICATION_CHANNEL', // (required)
    channelName: 'QB_PUSH_NOTIFICATION_CHANNEL', // (required)
    playSound: false, // (optional) default: true
    soundName: 'default', // (optional) See `soundName` parameter of `localNotification` function
  },
  created => console.log(`createChannel returned '${created}'`) // (optional) callback returns whether the channel was created, false means it already existed.
);

AppRegistry.registerComponent(name, () => app);

This is the version I am using:

"react-native-push-notification": "^7.2.3"
@Dallas62
Copy link
Collaborator

Can you share the content of onNotification ?
Also, are you testing on Release or Debug ?

@stephanoparaskeva
Copy link
Author

stephanoparaskeva commented Mar 31, 2021

Can you share the content of onNotification ?
Also, are you testing on Release or Debug ?

Hi @Dallas62 we are testing on debug mode I think but we are not certain, how do we know for sure?

Here is the content of onNotification, it sends a notification to another phone so that we know the onNotification function successfully runs. This works on IOS but not in background on Android. It does work in the foreground on Android (Successfully sends notification to another phone) as well.

const onNotification = async (notification: any) => {
  // If the notification is for an incoming message
  console.warn(notification, '¥');

  try {
    const notif = await QB.events.create({
      payload: { message: 'onNotification response' },
      recipientsIds: [Number(notification.initiatorId || notification.data.initiatorId)],
      notificationType: 'push',
      type: 'one_shot',
      senderId: 127187384,
    });
    console.warn(notif);
  } catch (err) {
    console.warn(err);
  }

  notification.finish(PushNotificationIOS.FetchResult.NoData);
};

There is also no log in the console via console.warn when a notification is sent in the background.

@Dallas62
Copy link
Collaborator

I just test on the exemple project, and I'm able to receive the notification data:

NotificationHandler: {"data": {"initiatorId": "1234"}, "finish": [Function finish], "foreground": false, "id": "-274925995", "userInteraction": false}

The test is in debug, with metro bundler.

@Dallas62
Copy link
Collaborator

In order to clean up more the AndroidManifest (Deprecated entry of this library only), you can test this one:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.euclid">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <uses-permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />

    <application
            android:name=".MainApplication"
            android:allowBackup="false"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:theme="@style/AppTheme"
            tools:ignore="GoogleAppIndexingWarning">
        <activity
                android:name=".MainActivity"
                android:launchMode="singleTask"
                android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
                android:label="@string/app_name"
                android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="euclid" />
            </intent-filter>
        </activity>
        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

        <meta-data  android:name="com.dieam.reactnativepushnotification.notification_foreground"
            android:value="false"/>

      <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
      <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
      <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
          <intent-filter>
              <action android:name="android.intent.action.BOOT_COMPLETED" />
              <action android:name="android.intent.action.QUICKBOOT_POWERON" />
              <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
          </intent-filter>
      </receiver>

      <service
          android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
          android:exported="false" >
          <intent-filter>
              <action android:name="com.google.firebase.MESSAGING_EVENT" />
          </intent-filter>
      </service>

        <meta-data
            android:name="com.dieam.reactnativepushnotification.notification_color"
            android:resource="@color/primary" />
        <meta-data
            android:name="com.dieam.reactnativepushnotification.default_notification_channel_id"
            android:value="QB_PUSH_NOTIFICATION_CHANNEL" />

        <service android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

         <service
                 android:name="io.wazo.callkeep.VoiceConnectionService"
                 android:label="Wazo"
                 android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
                 android:foregroundServiceType="camera|microphone">
            <intent-filter>
                <action android:name="android.telecom.ConnectionService" />
            </intent-filter>
        </service>

        <service android:name="io.wazo.callkeep.RNCallKeepBackgroundMessagingService" />

        <meta-data
            android:name="com.quickblox.messages.TYPE"
            android:value="FCM" />
        <meta-data
            android:name="com.quickblox.messages.SENDER_ID"
            android:value="48255260124" />
        <meta-data
            android:name="com.quickblox.messages.QB_ENVIRONMENT"
            android:value="DEVELOPMENT" />
    </application>
</manifest>

@Dallas62
Copy link
Collaborator

You can also clean and re-build the Android project to be sure latest version of the library is used.

@stephanoparaskeva
Copy link
Author

You can also clean and re-build the Android project to be sure latest version of the library is used.

HI @Dallas62 It seems I have mistaken the logcat response.

The logs from the first background push notification sent are these:

021-03-31 14:06:45.101 8793-8872/com.euclid D/InCallManager: InCallManager initialized
2021-03-31 14:06:45.115 8793-8876/com.euclid V/RNKeychainManager: warming up started at 42571572224053
2021-03-31 14:06:45.118 8793-8876/com.euclid D/RNKeychainManager: Probe cipher storage: CipherStorageFacebookConceal
2021-03-31 14:06:45.118 8793-8876/com.euclid D/RNKeychainManager: Probe cipher storage: CipherStorageKeystoreAesCbc
2021-03-31 14:06:45.142 8793-8876/com.euclid D/RNKeychainManager: Probe cipher storage: CipherStorageKeystoreRsaEcb
2021-03-31 14:06:45.145 8793-8876/com.euclid D/RNKeychainManager: Selected storage: CipherStorageKeystoreAesCbc
2021-03-31 14:06:45.154 8793-8876/com.euclid E/KeyStore: generateKeyInternal failed on request -68
2021-03-31 14:06:45.160 8793-8876/com.euclid W/CipherStorageBase: StrongBox security storage is not available.
    android.security.keystore.StrongBoxUnavailableException: Failed to generate key
        at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineGenerateKey(AndroidKeyStoreKeyGeneratorSpi.java:329)
        at javax.crypto.KeyGenerator.generateKey(KeyGenerator.java:612)
        at com.oblador.keychain.cipherStorage.CipherStorageKeystoreAesCbc.generateKey(CipherStorageKeystoreAesCbc.java:220)
        at com.oblador.keychain.cipherStorage.CipherStorageBase.tryGenerateStrongBoxSecurityKey(CipherStorageBase.java:444)
        at com.oblador.keychain.cipherStorage.CipherStorageBase.generateKeyAndStoreUnderAlias(CipherStorageBase.java:391)
        at com.oblador.keychain.KeychainModule.internalWarmingBestCipher(KeychainModule.java:173)
        at com.oblador.keychain.KeychainModule.lambda$NuQDyTTfZc67dTNiVeEDbYNRCJw(Unknown Source:0)
        at com.oblador.keychain.-$$Lambda$KeychainModule$NuQDyTTfZc67dTNiVeEDbYNRCJw.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.security.KeyStoreException: No StrongBox available
        at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineGenerateKey(AndroidKeyStoreKeyGeneratorSpi.java:329) 
        at javax.crypto.KeyGenerator.generateKey(KeyGenerator.java:612) 
        at com.oblador.keychain.cipherStorage.CipherStorageKeystoreAesCbc.generateKey(CipherStorageKeystoreAesCbc.java:220) 
        at com.oblador.keychain.cipherStorage.CipherStorageBase.tryGenerateStrongBoxSecurityKey(CipherStorageBase.java:444) 
        at com.oblador.keychain.cipherStorage.CipherStorageBase.generateKeyAndStoreUnderAlias(CipherStorageBase.java:391) 
        at com.oblador.keychain.KeychainModule.internalWarmingBestCipher(KeychainModule.java:173) 
        at com.oblador.keychain.KeychainModule.lambda$NuQDyTTfZc67dTNiVeEDbYNRCJw(Unknown Source:0) 
        at com.oblador.keychain.-$$Lambda$KeychainModule$NuQDyTTfZc67dTNiVeEDbYNRCJw.run(Unknown Source:2) 
        at java.lang.Thread.run(Thread.java:919) 
2021-03-31 14:06:45.168 8793-8872/com.euclid E/unknown:ReactNative: ReactInstanceManager.createReactContext: mJSIModulePackage null
2021-03-31 14:06:45.170 8793-8881/com.euclid E/ReactNativeJNI: logMarker CREATE_REACT_CONTEXT_END
2021-03-31 14:06:45.174 8793-8881/com.euclid E/ReactNativeJNI: logMarker RUN_JS_BUNDLE_START
2021-03-31 14:06:45.176 8793-8876/com.euclid V/RNKeychainManager: warming up takes: 60 ms
2021-03-31 14:06:45.180 8793-8793/com.euclid W/unknown:ReactNative: Packager connection already open, nooping.
2021-03-31 14:06:45.182 8793-8793/com.euclid V/RNPushNotification: sendNotification: Bundle[{userInteraction=false, id=-1287770038, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 14:06:45.201 8793-8793/com.euclid D/RNPushNotification: Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: Bundle[{userInteraction=false, id=-1287770038, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 14:06:45.385 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
2021-03-31 14:06:45.389 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
2021-03-31 14:06:45.393 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
2021-03-31 14:06:45.395 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
2021-03-31 14:06:45.399 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
2021-03-31 14:06:45.399 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
2021-03-31 14:06:45.401 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
2021-03-31 14:06:45.406 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
2021-03-31 14:06:45.411 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
2021-03-31 14:06:45.414 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
2021-03-31 14:06:45.416 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
2021-03-31 14:06:45.419 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
2021-03-31 14:06:45.425 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
2021-03-31 14:06:45.425 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
2021-03-31 14:06:45.427 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
2021-03-31 14:06:45.429 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
2021-03-31 14:06:45.432 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
2021-03-31 14:06:45.434 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
2021-03-31 14:06:45.436 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
2021-03-31 14:06:45.439 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
2021-03-31 14:06:45.440 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
2021-03-31 14:06:45.443 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
2021-03-31 14:06:45.444 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
2021-03-31 14:06:45.445 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
2021-03-31 14:06:45.446 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
2021-03-31 14:06:45.448 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
2021-03-31 14:06:45.451 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
2021-03-31 14:06:45.453 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
2021-03-31 14:06:45.454 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
2021-03-31 14:06:45.454 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
2021-03-31 14:06:45.455 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
2021-03-31 14:06:45.465 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
2021-03-31 14:06:45.473 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
2021-03-31 14:06:45.475 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
2021-03-31 14:06:45.476 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
2021-03-31 14:06:45.481 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
2021-03-31 14:06:45.482 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
2021-03-31 14:06:45.483 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
2021-03-31 14:06:45.486 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class org.reactnative.maskedview.RNCMaskedViewManager
2021-03-31 14:06:45.489 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.quickblox.reactnative.webrtc.WebRTCVideoViewManager
2021-03-31 14:06:45.492 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.henninghall.date_picker.DatePickerManager
2021-03-31 14:06:45.494 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager
2021-03-31 14:06:45.495 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.gesturehandler.react.RNGestureHandlerButtonViewManager
2021-03-31 14:06:45.498 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.BV.LinearGradient.LinearGradientManager
2021-03-31 14:06:45.501 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.th3rdwave.safeareacontext.SafeAreaProviderManager
2021-03-31 14:06:45.503 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.th3rdwave.safeareacontext.SafeAreaViewManager
2021-03-31 14:06:45.503 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.th3rdwave.safeareacontext.SafeAreaViewShadowNode
2021-03-31 14:06:45.508 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreenContainerViewManager
2021-03-31 14:06:45.510 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreenViewManager
2021-03-31 14:06:45.514 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreenStackViewManager
2021-03-31 14:06:45.517 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreenStackHeaderConfigViewManager
2021-03-31 14:06:45.520 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreenStackHeaderSubviewManager
2021-03-31 14:06:45.525 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.oblador.shimmer.RNShimmerManager
2021-03-31 14:06:45.529 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$GroupViewManager
2021-03-31 14:06:45.537 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$RenderableShadowNode
2021-03-31 14:06:45.541 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$PathViewManager
2021-03-31 14:06:45.544 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$CircleViewManager
2021-03-31 14:06:45.546 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$EllipseViewManager
2021-03-31 14:06:45.547 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$LineViewManager
2021-03-31 14:06:45.548 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$RectViewManager
2021-03-31 14:06:45.550 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$TextViewManager
2021-03-31 14:06:45.552 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$TSpanViewManager
2021-03-31 14:06:45.554 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$TextPathViewManager
2021-03-31 14:06:45.555 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$ImageViewManager
2021-03-31 14:06:45.556 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$ClipPathViewManager
2021-03-31 14:06:45.556 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$DefsViewManager
2021-03-31 14:06:45.557 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$UseViewManager
2021-03-31 14:06:45.558 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$SymbolManager
2021-03-31 14:06:45.560 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$LinearGradientManager
2021-03-31 14:06:45.562 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$RadialGradientManager
2021-03-31 14:06:45.566 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$PatternManager
2021-03-31 14:06:45.572 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$MaskManager
2021-03-31 14:06:45.575 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$ForeignObjectManager
2021-03-31 14:06:45.579 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.RenderableViewManager$MarkerManager
2021-03-31 14:06:45.581 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.horcrux.svg.SvgViewManager
2021-03-31 14:06:45.585 8793-8882/com.euclid W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.brentvatne.react.ReactVideoViewManager
2021-03-31 14:06:45.628 8793-8882/com.euclid I/flipper: flipper: FlipperClient::addPlugin Fresco
2021-03-31 14:06:45.639 8793-8793/com.euclid E/unknown:ReactNative: Unable to launch logbox because react was unable to create the root view
2021-03-31 14:06:45.711 8793-8881/com.euclid D/SoLoader: About to load: libreactnativeblob.so
2021-03-31 14:06:45.711 8793-8881/com.euclid D/SoLoader: libreactnativeblob.so not found on /data/data/com.euclid/lib-main
2021-03-31 14:06:45.711 8793-8881/com.euclid D/SoLoader: libreactnativeblob.so found on /data/app/com.euclid-ob9xZnXgau6xg25VDwqmrg==/lib/x86
2021-03-31 14:06:45.711 8793-8881/com.euclid D/SoLoader: Not resolving dependencies for libreactnativeblob.so
2021-03-31 14:06:45.712 8793-8881/com.euclid D/SoLoader: Loaded: libreactnativeblob.so
2021-03-31 14:06:45.728 8793-8882/com.euclid I/WebViewFactory: Loading com.google.android.webview version 74.0.3729.185 (code 373018518)
2021-03-31 14:06:45.733 8793-8882/com.euclid I/com.euclid: The ClassLoaderContext is a special shared library.
2021-03-31 14:06:45.743 8793-8882/com.euclid I/com.euclid: The ClassLoaderContext is a special shared library.
2021-03-31 14:06:45.850 8793-8882/com.euclid I/cr_LibraryLoader: Time to load native libraries: 7 ms (timestamps 2300-2307)
2021-03-31 14:06:45.861 8793-8882/com.euclid I/chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0
2021-03-31 14:06:45.861 8793-8882/com.euclid I/cr_LibraryLoader: Expected native library version number "74.0.3729.185", actual native library version number "74.0.3729.185"
2021-03-31 14:06:46.410 8793-8882/com.euclid D/InCallManager: RNInCallManager.checkRecordPermission(): enter
2021-03-31 14:06:46.411 8793-8882/com.euclid D/InCallManager: RNInCallManager.checkRecordPermission(): recordPermission=granted
2021-03-31 14:06:46.473 8793-8882/com.euclid D/InCallManager: RNInCallManager.checkCameraPermission(): enter
2021-03-31 14:06:46.473 8793-8882/com.euclid D/InCallManager: RNInCallManager.checkCameraPermission(): cameraPermission=granted
2021-03-31 14:06:46.484 8793-8882/com.euclid D/RNKeychainManager: Probe cipher storage: CipherStorageFacebookConceal
2021-03-31 14:06:46.484 8793-8882/com.euclid D/RNKeychainManager: Probe cipher storage: CipherStorageKeystoreAesCbc
2021-03-31 14:06:46.484 8793-8882/com.euclid D/RNKeychainManager: Probe cipher storage: CipherStorageKeystoreRsaEcb
2021-03-31 14:06:46.484 8793-8882/com.euclid D/RNKeychainManager: Selected storage: CipherStorageKeystoreAesCbc
2021-03-31 14:06:46.501 8793-8882/com.euclid D/RNCK:VoiceConnectionService: setAvailable: false
2021-03-31 14:06:46.508 8793-8882/com.euclid D/RNCK:VoiceConnectionService: setAvailable: true
2021-03-31 14:06:46.512 8793-8882/com.euclid D/RNCK:VoiceConnectionService: setAvailable: true
2021-03-31 14:06:46.518 8793-8881/com.euclid E/ReactNativeJNI: logMarker RUN_JS_BUNDLE_END
2021-03-31 14:06:46.560 8793-8881/com.euclid W/ReactNativeJS: { foreground: false,
      finish: [Function: finish],
      userInteraction: false,
      id: '-1287770038',
      data: { initiatorId: '127167807' } }, '¥'
2021-03-31 14:06:46.584 8793-8881/com.euclid I/ReactNativeJS: createChannel returned 'false'
2021-03-31 14:06:46.587 8793-8882/com.euclid E/unknown:ReactNative: CatalystInstanceImpl caught native exception
    java.lang.RuntimeException: applicationId is null. You must call QBSettings.getInstance().init(Context, String, String, String) before using the QuickBlox library.
        at com.quickblox.core.helper.Decorators.requireNonNullInRuntime(Unknown Source:5)
        at com.quickblox.auth.session.QBSettings.checkInit(Unknown Source:4)
        at com.quickblox.auth.session.BaseService.createBaseService(Unknown Source:8)
        at com.quickblox.auth.QBAuth.createSession(Unknown Source:0)
        at com.quickblox.auth.session.Query.createSessionByParameters(Unknown Source:3)
        at com.quickblox.auth.session.Query.createSessionIfNeedAsync(Unknown Source:34)
        at com.quickblox.auth.session.Query.performAsync(Unknown Source:22)
        at com.quickblox.reactnative.notificationevents.NotificationEventsModule.create(NotificationEventsModule.java:197)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:214)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:919)
2021-03-31 14:06:46.587 8793-8882/com.euclid E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: applicationId is null. You must call QBSettings.getInstance().init(Context, String, String, String) before using the QuickBlox library.
        at com.quickblox.core.helper.Decorators.requireNonNullInRuntime(Unknown Source:5)
        at com.quickblox.auth.session.QBSettings.checkInit(Unknown Source:4)
        at com.quickblox.auth.session.BaseService.createBaseService(Unknown Source:8)
        at com.quickblox.auth.QBAuth.createSession(Unknown Source:0)
        at com.quickblox.auth.session.Query.createSessionByParameters(Unknown Source:3)
        at com.quickblox.auth.session.Query.createSessionIfNeedAsync(Unknown Source:34)
        at com.quickblox.auth.session.Query.performAsync(Unknown Source:22)
        at com.quickblox.reactnative.notificationevents.NotificationEventsModule.create(NotificationEventsModule.java:197)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:214)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:919)
2021-03-31 14:06:46.590 8793-8793/com.euclid E/unknown:ReactNative: Unable to launch redbox because react activity is not available, here is the error that redbox would've displayed: applicationId is null. You must call QBSettings.getInstance().init(Context, String, String, String) before using the QuickBlox library.
2021-03-31 14:06:46.604 8793-8910/com.euclid E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
    java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by WebSocketModule
        at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
        at com.facebook.react.modules.websocket.WebSocketModule.sendEvent(WebSocketModule.java:62)
        at com.facebook.react.modules.websocket.WebSocketModule.access$100(WebSocketModule.java:40)
        at com.facebook.react.modules.websocket.WebSocketModule$1.onMessage(WebSocketModule.java:190)
        at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.java:323)
        at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:219)
        at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:105)
        at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:274)
        at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:214)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2021-03-31 14:06:46.606 8793-8910/com.euclid I/chatty: uid=10141(com.euclid) .0.2.2:8081/... identical 2 lines
2021-03-31 14:06:46.607 8793-8910/com.euclid E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
    java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by WebSocketModule
        at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
        at com.facebook.react.modules.websocket.WebSocketModule.sendEvent(WebSocketModule.java:62)
        at com.facebook.react.modules.websocket.WebSocketModule.access$100(WebSocketModule.java:40)
        at com.facebook.react.modules.websocket.WebSocketModule$1.onMessage(WebSocketModule.java:190)
        at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.java:323)
        at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:219)
        at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:105)
        at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:274)
        at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:214)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2021-03-31 14:06:46.608 8793-8839/com.euclid W/unknown:ReactNative: Invoking JS callback after bridge has been destroyed.
2021-03-31 14:06:49.503 8793-8837/com.euclid V/FA: Inactivity, disconnecting from the service

The logs for subsequent background pushes are these:

2021-03-31 14:09:41.324 8793-9011/com.euclid V/RNPushNotification: onMessageReceived: Bundle[{data=Bundle[{initiatorId=127167807}]}]
2021-03-31 14:09:41.327 8793-8793/com.euclid V/RNPushNotification: sendNotification: Bundle[{userInteraction=false, id=-1168488657, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 14:09:41.329 8793-8793/com.euclid D/RNPushNotification: Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: Bundle[{userInteraction=false, id=-1168488657, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 14:09:44.580 8793-9015/com.euclid V/RNPushNotification: onMessageReceived: Bundle[{data=Bundle[{initiatorId=127167807}]}]
2021-03-31 14:09:44.583 8793-8793/com.euclid V/RNPushNotification: sendNotification: Bundle[{userInteraction=false, id=910167417, data=Bundle[{initiatorId=127167807}], foreground=false}]
2021-03-31 14:09:44.586 8793-8793/com.euclid D/RNPushNotification: Ignore this message if you sent data-only notification. Cannot send to notification centre because there is no 'message' field in: Bundle[{userInteraction=false, id=910167417, data=Bundle[{initiatorId=127167807}], foreground=false}]

I hope this helps

@Dallas62
Copy link
Collaborator

Dallas62 commented Mar 31, 2021

@stephanoparaskeva
As I can see, everything is ok from the library.
You got the warning as expected:

2021-03-31 14:06:46.560 8793-8881/com.euclid W/ReactNativeJS: { foreground: false,
      finish: [Function: finish],
      userInteraction: false,
      id: '-1287770038',
      data: { initiatorId: '127167807' } }, '¥'

The issue comes from another library which might not be configured when the code is running:

java.lang.RuntimeException: applicationId is null. You must call QBSettings.getInstance().init(Context, String, String, String) before using the QuickBlox library.

@stephanoparaskeva
Copy link
Author

stephanoparaskeva commented Mar 31, 2021

@stephanoparaskeva
As I can see, everything is ok from the library.
You got the warning as expected:

2021-03-31 14:06:46.560 8793-8881/com.euclid W/ReactNativeJS: { foreground: false,
      finish: [Function: finish],
      userInteraction: false,
      id: '-1287770038',
      data: { initiatorId: '127167807' } }, '¥'

The issue come from another library which might be not configured when the code is running:

java.lang.RuntimeException: applicationId is null. You must call QBSettings.getInstance().init(Context, String, String, String) before using the QuickBlox library.

Thank you!

Is this the only problem you notice, is there more errors that look like a problem and is there something more fundamental I am misunderstanding about how to implement this stuff?

@Dallas62
Copy link
Collaborator

I think it's the only issue, this problably occure because the QBSettings library has an asynchrone initialisation on Android and Synchrone on iOS. Or a race condition.

@stephanoparaskeva
Copy link
Author

stephanoparaskeva commented Mar 31, 2021

I think it's the only issue, this problably occure because the QBSettings library has an asynchrone initialisation on Android and Synchrone on iOS. Or a race condition.

Ah that is a great explanation,
Before I close, could I ask what your opinion on the error in the log that mentions StrongBox or something, this is not something I can easily understand I use react-native-keychain and react-native-persist-keychain to persist auth info like login via the keychain for redux it could be related to this, but what do you think could cause the error and is there anything you can intuitively decipher from this ?

Thank you so much for all of the help!

Feel free to ignore and I will close tonight if no response

@Dallas62
Copy link
Collaborator

Probably this issue:
oblador/react-native-keychain#337
But I don't use this library 😕

@stephanoparaskeva
Copy link
Author

Probably this issue:

oblador/react-native-keychain#337

But I don't use this library 😕

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants