flutter_freshchat icon indicating copy to clipboard operation
flutter_freshchat copied to clipboard

Does this plugin support push notifications?

Open kaumudpa opened this issue 5 years ago • 20 comments

Unable to send push notifications, Please let me know if this supports it? if yes - any specific process to implement push notifications FCM

kaumudpa avatar Sep 04 '19 10:09 kaumudpa

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

fayeed avatar Sep 05 '19 11:09 fayeed

I tried it, but unable to use it! Can you give it a try?

kaumudpa avatar Sep 05 '19 13:09 kaumudpa

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.

fayeed avatar Sep 08 '19 18:09 fayeed

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

savy-91 avatar Nov 25 '19 20:11 savy-91

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.

fayeed avatar Nov 26 '19 03:11 fayeed

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.

MuhammedRefaat avatar Feb 18 '20 09:02 MuhammedRefaat

I think I solved it for Android.

  1. Add dependency in <app-name>/android/app/build.gradle
dependencies {
  // ...
  implementation "com.github.freshdesk:freshchat-android:3.3.0"
}
  1. Create FreshchatMessagingService.java (Java, not Kotlin) class to your app in the same directory as your MainActivity class
package <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);
        }
    }
}
  1. In AndroidManifest.xml add
<service android:name=".FreshchatMessagingService">
  <intent-filter>
    <action android:name="com.google.firebase.MESSAGING_EVENT" />
  </intent-filter>
</service>
  1. In your Application class change
FlutterFirebaseMessagingService.setPluginRegistrant(this)

to

FreshchatMessagingService.setPluginRegistrant(this)

It's work for me.

Syaba999 avatar May 07 '20 21:05 Syaba999

Thanks @Syaba999 , this actually works on Android!

savy-91 avatar May 08 '20 07:05 savy-91

@fayeed are you sure that the push notifications work on iOS?

savy-91 avatar May 08 '20 09:05 savy-91

@Syaba999 got it on Android, thanks!

But for me iOS push never arrive

Ciock avatar Jul 29 '20 15:07 Ciock

@Syaba999 Would you be open to create a PR to add this in the Readme?

fayeed avatar Jul 31 '20 02:07 fayeed

@Syaba999 Would you be open to create a PR to add this in the Readme?

Ok

Syaba999 avatar Jul 31 '20 11:07 Syaba999

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.

julian247 avatar Oct 14 '20 09:10 julian247

@Syaba999 @fayeed I have to correct: With Android it works without problems. But not with iOS.

julian247 avatar Oct 14 '20 10:10 julian247

anyone was able to make it working with iOS & andriod?

louna-akkad avatar Jan 17 '21 09:01 louna-akkad

Works on android, but not on IOS.

kent-cabarle avatar Feb 04 '21 13:02 kent-cabarle

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

silverAndroid avatar Mar 04 '21 12:03 silverAndroid

Hello. Please make it work for iOS. I tried everything but it doesn't work. Was anybody able to make it work?

teknofreek avatar Dec 03 '21 19:12 teknofreek

@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

dynacorp avatar Dec 29 '21 15:12 dynacorp

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

MuhammedRefaat avatar Dec 30 '21 05:12 MuhammedRefaat