Not receiving network callbacks from livechat when my App is in background. Only on android on Ios it works fine - react-native

I have a chatting app and i am using livechat sdk to communicate between agent and client.When a chat is started {On chat started} callback is not received by the android app when its in background however its being received when its in foreground and its being received on the Ios app when its in background and foreground both.Is there anyway to capture the callback from livechat in background on android? Any help will be really appreciated.

Related

displaying notifications when the app is killed - React Native

I have a problem with diplaying notification while running socket connection in the background service i'm using react-native-backgound-action.
Problems i have right now:
when notification is sent from the backend nothing is been shown i'm using "stompJS" as socket connection and notifee as notification package.
react native background actions use forground service that shows a permanent notification in android.
i have tried to run notification in background

Push notification audio not playing when app is in background - OneSignal React Native

I have an application built with react native using onesignal for push notifications. On specific devices (panasonic fz-a3) the push notification is received but no audio is playing when the application is running in the background.
If the application is closed the push is received with audio notification.
I have verified that the android channel is setup properly and the audio is playing on other android devices (samsung) but cant figure out what is missing on these specific panasonic devices (fz-a3)
any help or suggestion is appreciated

react-native-firebase - Open app from Headless JS Service / Open app from received notification in background mode

I read
How to handle notification when app in background in Firebase
Open app on firebase notification received (FCM)
But these aren't the solution for react-native-firebase.
I'm using react-native-firebase to handle notifications. In foreground, everything works well. I stuck with background state.
I'm working on a chat project and making 1-to-1 call feature. I push data-notification to clients when they have a call. In iOS, I used CallKit when client received notification, and it worked fine. But in Android I have a problem:
I can show ConnectionService UI for a call, but can't connect to my web socket server because it runs on Headless JS service. So I tried to auto open the app. I want to show a call screen as Skype, and accept/deny the call. (Skype can launch the app when I have a call)
Summary, successful steps:
Receive call notification in foreground state and show calling screen.
Receive call notification in background/closed state and show calling screen on iOS.
Receive call notification in background/closed state on Android.
Stuck here:
Show calling screen in background/closed on Android ???
TL;DR - How to launch/run/open Android app from Headless JS Service?
I dig into react-native-firebase, it catches the notification on onMessageReceived and send notification message to Headless JS Service.
// If the app is in the background we send it to the Headless JS Service
Intent headlessIntent = new Intent(
this.getApplicationContext(),
RNFirebaseBackgroundMessagingService.class
);
headlessIntent.putExtra("message", message);
this
.getApplicationContext()
.startService(headlessIntent);
HeadlessJsTaskService.acquireWakeLockNow(this.getApplicationContext());
Any help would be appreciated
This library is helpful to open app from background state.
React Native Launch Application
If your app is quit from background state
you've to register registerHeadlessTask in index.js like this
AppRegistry.registerHeadlessTask(
'ReactNativeFirebaseMessagingHeadlessTask',
() => notificationActionHandler,
);
and in notificationActionHandler function call libraries function to open app
If your app is in background you can subscribe this
messaging().setBackgroundMessageHandler(remoteMessage => {
console.log('setBackgroundMessageHandler', remoteMessage.data);
})

Not able to get notification in bar when app is opened

I have implemented push notification using gcm in my ionic 2 app, the notification works fine in background and foreground, but the issue is that when app is in foreground the notification doesn't appear in notification bar. Please help
You may refer with this forum:Ionic 2, Android notification received but banner not showing on device.
It stated that if the app is in the foreground, the notification is not shown in the system tray. That only happens when the notification is received while the app is in the background.
Additional references:
GCM notification doesn't show up in the notification bar. Android
push notification doesn't show up on status bar
Android - GCM push notifications not appearing in notifications list

Quick fix to solve XMPP iOS VoIP background execution rejection by appestore

I developed an xmpp ios chat application. The application requires the functionality of receiving the chat messages even if the application in background state. In order to achieve this, i used VoIP background execution to stay the user session alive instead of implementing apple push notification . The application is working fine. But the problem is that, the application is rejected by the appstore(Meta data rejection). Is there any quick way to solve this issue ??? Thanks in advance.
By giving background mode capabilities would not allow to make your app live if there is no functionality of VOIP in the app.
Use Pushkit ( Silent push notification ) like whatsapp, facebook etc chat app to keep your chat functionality in background or kill state.
Let me know if i could help you in push kit or anything else.