Open kaumudpa opened 5 years ago
Well did you use setupPushNotifications
you will need to pass the pushToken
to it that should work I guess.
Prerequisites:
- FCM Implemented in your app
- Device running Play Services
- FCM Server Key to get push notifications working with Freshchat
I tried it, but unable to use it! Can you give it a try?
I don't have the time right to look into this issue, so I will keep this issue open till I fixed it or maybe someone else.
I can confirm I cannot manage to enable push notifications. At the moment I can't look into it, but I might be able to help soon
I did checked the push notification and it seems to work on IOS, didn't get to check on android, can you also check on IOS and let me know.
Actually it's not working on my side also, I tried with both Android & ios, despite I'm calling
FlutterFreshchat.setupPushNotifications(token: fcmToken);
and
await _channel.invokeMethod('setupPushNotifications', params);
returns true.
I think I solved it for Android.
<app-name>/android/app/build.gradle
dependencies {
// ...
implementation "com.github.freshdesk:freshchat-android:3.3.0"
}
FreshchatMessagingService.java
(Java, not Kotlin) class to your app in the same directory as your MainActivity
classpackage <your package's identifier>;
import com.freshchat.consumer.sdk.Freshchat;
import com.google.firebase.messaging.RemoteMessage;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
public class FreshchatMessagingService extends FlutterFirebaseMessagingService {
@Override
public void onNewToken(String token) {
super.onNewToken(token);
}
@Override
public void onMessageReceived(final RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
if (Freshchat.isFreshchatNotification(remoteMessage)) {
Freshchat.handleFcmMessage(this, remoteMessage);
}
}
}
AndroidManifest.xml
add<service android:name=".FreshchatMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
Application
class change
FlutterFirebaseMessagingService.setPluginRegistrant(this)
to
FreshchatMessagingService.setPluginRegistrant(this)
It's work for me.
Thanks @Syaba999 , this actually works on Android!
@fayeed are you sure that the push notifications work on iOS?
@Syaba999 got it on Android, thanks!
But for me iOS push never arrive
@Syaba999 Would you be open to create a PR to add this in the Readme?
@Syaba999 Would you be open to create a PR to add this in the Readme?
Ok
Unfortunately the suggested solution does not work for me (iOS & android). Have you been able to solve the problem in the meantime?
Thanks a lot in advance.
@Syaba999 @fayeed I have to correct: With Android it works without problems. But not with iOS.
anyone was able to make it working with iOS & andriod?
Works on android, but not on IOS.
For iOS, you should be able to debug why the notification isn't arriving. (It's React Native docs but should help the same) https://support.freshchat.com/support/solutions/articles/50000002925-steps-to-debug-react-native-ios-push-notification
Hello. Please make it work for iOS. I tried everything but it doesn't work. Was anybody able to make it work?
@teknofreek it still doesn't work, I have tried all I can, it's not connecting via the APN certificates or AuthKeys(Firebase)... if anyone has done this please put us through
@teknofreek it still doesn't work, I have tried all I can, it's not connecting via the APN certificates or AuthKeys(Firebase)... if anyone has done this please put us through
Actually I've switched to use the official plugin released by freshchat for flutter.
Unable to send push notifications, Please let me know if this supports it? if yes - any specific process to implement push notifications FCM