Ionic push notification for ios using FCM - firebase

I am trying to send push notification on my iOS device with the help of FCM and ionic 3. But I'm unable to get on my device, for android it is working fine, but for iOS its not working. I'm getting device token for iOS and I've enabled push notification from xcode also.
Is there any other configuration, which I'm missing between iOS and FCM?

Yes.
Steps for ios FCM Integration:
Add the GoogleService-info.plist file in to the root folder of your app.
Add the plugin to your app following this link : https://ionicframework.com/docs/native/fcm/
Write the necessary code
Run command in terminal/cmd 'ionic cordova prepare'
Open Xcode and allow the code to be indexed.
Click on 'show project navigator' on the extreme left hand side below run button. Check the Resources Folder and click on GoogleService-info.plist. If it is empty, delete it and manually place the file again in that folder by dragging and dropping.
Under Capabilities, ON push notifications and ON background modes> remote notifications
8 Upload p8 file on firebase console.
9 and you're done! Test your notification :)
Note: Don't forget to use actual device to test this feature. iOS Simulator doesn't support notifications.
App Crash Issue: Make sure that platforms/ios/MyApp/Resources/Resources/GoogleService-Info.plist and platforms/ios/MyApp/Resources/GoogleService-Info.plist
are same and complete. An incomplete file on any of the above paths can lead to crashing of the app.

Related

ionic 5 app with firebase debugging offline mode

So, I have an ionic 5 app with capacitor 3 and a firebase real-time database. I want to make sure that my app works offline. For that, I am struggling to test it.
I am currently using ios and able to deploy the app on the device using below:
ionic cap run ios -l --external
I can see the app logs using safari dev module when my device has data connection. however, when i turn it off the safari cannot show me device data. So, how do i first of all see that?

Problem with Firebase in SwiftUI macos app. [Running InstanceID on a simulator doesn't have APNS. Use prod profile by default.]

I wanted to run my swiftui app on macos, unfortunately i can still see error That
Running InstanceID on a simulator doesn't have APNS. Use prod
profile by default.
I used the code from firebase messaging docs to initialize firebase messaging and later on I wanted to get instance id token.
While using Xcode I don't get any other errors instead of this which I mentioned. That's why I decided to archive my app and run it independently
outside Xcode. Unfortunately I still can see in console error message about running in simulator. When I run that code on my physical iPhone everything works properly.
Xcode log
Mac console log
Does anyone know what should I change or how should I archive the app properly in order to firebase not detect my app as simulator?

Firebase not reporting android activity

We are using Firebase for push notifications for Android and iOS, and all the notifications are working perfectly.
But when I log into firebase, and try to see the activity in “Streamview”, I see only iOS activity, and nothing for Android.
I do see the activity in Cloud messaging’s Report section, for both iOS and Android.
The application we have built is built using Xamarin forms.
One thing to note from the Firebase console is that it doesn’t appear as though the console recognizes that SDK setup was fully complete.
When going into the link where it says “Continue SDK Setup”.
Finally, when proceeding to step #4 it tries to verify that there has been communication between the app and Google’s servers and it doesn’t seem to find anything and it just sits there looking.
Notifications appear to work, but the app just doesn’t seem to be registering as being used under the Android side.
Any pointers in this direction will be very helpful.
i don't have any idea what is wrong here.
I want to watch complete report of my push notifications sending count, for both platform Android and iOS. but i am getting only iOS report in stream view tab not for Android.
I made the comment above and now I have found an answer, at least for my situation. I had added Xamarin.Firebase.Core to the PCL project as the documentation suggests. Later I saw documentation for Android Java that showed Firebase Core being added to the gradle file at the app level. So I added Xamarin.Firebase.Core NuGet package to the Android project also and now I can see data for Android in the Firebase Console.

xcode 8 push notification capabilities and entitlements file setting

when using xcode 8 doing the push notification setting, unlike xcode 7, xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ),
then it will generate AppName.entitlements file as following
//AppName.entitlements
<key>aps-environment</key>
<string>development</string>
but for production version App, if we change the string to
//AppName.entitlements
<key>aps-environment</key>
<string>production</string>
then the Capabilities show a warning
and it seems no matter which string value specified in aps-environment, we can still get the push device token at application:didRegisterForRemoteNotificationsWithDeviceToken:
so what is the correct setting of the push notification entitlements?
thank you
I was struggling with that today in Xcode 8 GM. After disabling the setting, deleting my developer portal provisioning profile and regenerating it and enabling the setting again, I was able to eliminate the warning in Xcode. Keep in mind that I didn't fiddle with the entitlements file. I left it at development environment and after archiving I got the correct aps-environment setting (production).
Seems Xcode is stilly very buggy tho even in GM
My problem was my pusher client was out of date and would only push successfully to debug tokens. Other issue which I am still working on a fix for is that I could only export the app via gym with legacy-api enabled, this was not setting the apns-environment to be 'production' and leaving it as 'development' in the 'embedded-mobile.provision' file. I have however been able to successfully deploy the app via the xcode organiser to work with apns(prod) now.
I think the better solution is open the project package and open project.pbxproj
change the CODE_SIGN_ENTITLEMENTS
CODE_SIGN_ENTITLEMENTS = "your-app/production.entitlements";

phonegap build 3.3.0 + pushwoosh not working

I installed according to this guide: http://www.pushwoosh.com/programming-push-notification/android/android-additional-platforms/phonegap-build/
And I defined in pushwoosh the Certificate is needed.
IOS system I get an error
your provisioning profile does not have aps entry. Please make your profile push compatible
And Android app costs but I send notifications are not coming.
Where could be the problem? What am I doing wrong?
Thanks for the help!
You need to recreate your mobileprovisioning profile for the app in Apple Developer Portal.
Your current mobileprovisioning profile does not allow push notifications.
After recreating the profile, open it in any text editor and double check that it has "aps-environment" line.

Resources