Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS 9 onNotification dont dispatch #362

Open
pierrybos opened this issue Jul 31, 2017 · 9 comments
Open

IOS 9 onNotification dont dispatch #362

pierrybos opened this issue Jul 31, 2017 · 9 comments

Comments

@pierrybos
Copy link

pierrybos commented Jul 31, 2017

I have a project and testing FCMPlugin in a IOS10 and a 9. On my iPad 2 (with iOS 9) I recieve message, but on tap, onNotification is not dispatch. iOS 10 all is fine.

cordova-ios 4.3.1
cordova 7.0.1
fcm-plugin: 2.1.2

@CowboyCode
Copy link

Check this pull request out
#255

And if you ever want to submit your app to the apple app store, you wont get past this pull request.
#339

I use myself the updated sdk version, it works for me on ios 9 and 10.

@pierrybos
Copy link
Author

So... we need wait?

@CowboyCode
Copy link

CowboyCode commented Aug 3, 2017

I just use this pull request #339
and everything runs fine for me, upload to apple store no problems.

Look at all the pull requests, the project is not very active but it is still the best solution for fcm, I tried any other and it was always a struggle with outdated stuff.

I hope, we get sometime a good upgrade here, that would be great.
For now I install it right from git like below. That is my work account

npm install git+https://github.com/ostownsville/cordova-plugin-fcm.git

I you use that, you will have to, after installation, copy the GoogleService-Info file into the folder "platform/ios/projectname/Resources/Resources"

Depending on what you use, I use ionic.

@pierrybos
Copy link
Author

I tried with "cordova plugin add" but have problems to build with android. I will try again with "npm install"

@LoloBee
Copy link

LoloBee commented Aug 4, 2017

I installed it with

phonegap plugin add https://github.com/ostownsville/cordova-plugin-fcm.git --save

And I was able to compile both, iOS & Android. On android master was working but not on iOS. As soon as Apple let me deploy on testflight I'll report.

Thanks!

@CowboyCode
Copy link

For IOS to work you need to make the set up with the certificates in firebase under cloud settings.

Cheers

@CowboyCode
Copy link

@pierrybos you are right it has to be cordova plugin add git+......
If the android build doesn't work, follow the error messages.
It could be that you need a android sdk upgrade to 25.0, I believe to remember.

Just as an idea

@LoloBee
Copy link

LoloBee commented Aug 5, 2017

I know @CowboyCode I got it working with master, but in iOS, when app was if foreground and FCMPlugin.onNotification should be triggered, the phone enters in a kind of endless loop and as soon as I close the app or send it to background, notificatiin sound was received and in logs, the notificatiin was dispatched but triggering FCMPlugin.onNotification, not using iOS notification center.

If this behabiour persists I'll post some logs.

Kind regards

@CowboyCode
Copy link

Ok, in my javascript code i use

if(typeof(FCMPlugin) != 'undefined') {
   FCMPlugin.onNotification(function(data){
        console.log(data)
   })
}

Anyway, using that above, the app will only make a noise if the app is in background, if the app is open, you have to do some coding to show the message.

if(typeof(FCMPlugin) != 'undefined') {
   FCMPlugin.onNotification(function(data){
        alert(JSON.stringify(data))
   })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants