Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Does this plugin support push notifications? #12

Open
kaumudpa opened this issue Sep 4, 2019 · 20 comments
Open

Does this plugin support push notifications? #12

kaumudpa opened this issue Sep 4, 2019 · 20 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kaumudpa
Copy link

kaumudpa commented Sep 4, 2019

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

@fayeed
Copy link
Owner

fayeed commented Sep 5, 2019

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
Copy link
Author

kaumudpa commented Sep 5, 2019

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

@fayeed
Copy link
Owner

fayeed commented Sep 8, 2019

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 fayeed added bug Something isn't working help wanted Extra attention is needed labels Sep 8, 2019
@savy-91
Copy link
Contributor

savy-91 commented Nov 25, 2019

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
Copy link
Owner

fayeed commented Nov 26, 2019

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
Copy link

MuhammedRefaat commented Feb 18, 2020

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
Copy link
Contributor

Syaba999 commented May 7, 2020

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
Copy link
Contributor

savy-91 commented May 8, 2020

Thanks @Syaba999 , this actually works on Android!

@savy-91
Copy link
Contributor

savy-91 commented May 8, 2020

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

@Ciock
Copy link

Ciock commented Jul 29, 2020

@Syaba999 got it on Android, thanks!

But for me iOS push never arrive

@fayeed
Copy link
Owner

fayeed commented Jul 31, 2020

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

@Syaba999
Copy link
Contributor

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

Ok

@julian247
Copy link

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
Copy link

julian247 commented Oct 14, 2020

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

@louna-akkad
Copy link

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

@kent-cabarle
Copy link

Works on android, but not on IOS.

@silverAndroid
Copy link

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
Copy link

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

@dynacorp
Copy link

@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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests