fayeed / flutter_freshchat

The unofficial flutter plugin for Freshchat
https://pub.dartlang.org/packages/flutter_freshchat
MIT License
32 stars 36 forks source link

Does this plugin support push notifications? #12

Open kaumudpa opened 5 years ago

kaumudpa commented 5 years ago

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

fayeed commented 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
kaumudpa commented 5 years ago

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

fayeed commented 5 years ago

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.

savy-91 commented 4 years ago

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

fayeed commented 4 years ago

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.

MuhammedRefaat commented 4 years ago

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.

Syaba999 commented 4 years ago

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.

savy-91 commented 4 years ago

Thanks @Syaba999 , this actually works on Android!

savy-91 commented 4 years ago

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

Ciock commented 4 years ago

@Syaba999 got it on Android, thanks!

But for me iOS push never arrive

fayeed commented 4 years ago

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

Syaba999 commented 4 years ago

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

Ok

julian247 commented 4 years ago

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 commented 4 years ago

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

louna-akkad commented 3 years ago

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

kent-cabarle commented 3 years ago

Works on android, but not on IOS.

silverAndroid commented 3 years ago

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

teknofreek commented 2 years ago

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

dynacorp commented 2 years ago

@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

MuhammedRefaat commented 2 years ago

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