Open pasza01 opened 7 years ago
Hello, I use the Legacy key.
Please note that it must have key=
before the actual key.
Eg. 'Authorization' : 'key=000000000000000000000000000000000000000'
Also, just a reminder: This is for testing only, if you want to use this on a Release build you will need a couple of changes. https://github.com/LuisRodriguezLD/Fuse-Firebase-Notifications#important-ios
Did the legacy server. Enable push on xcode still no success. Sandbox is true, because i am testing internally. for certificate, I uploaded .p8 certificate. A lot of certificate don't know which one to use.
Ah, apparently Firebase edited some of the documentation. And it now prefers Keys rather than certificates. I will update this repo soon but it still works, just follow this steps. The certificate you need is a .p12 file.
1) Create a Push Notification certificate from the Developer page (https://developer.apple.com/account/ios/certificate/create)
2) Select Apple Push Notification service SSL (Sandbox & Production)
3) Choose your App Id (This must match your Fuse Project)
4) Create a Certificate Signing Request (CSR) (Just follow the instructions on screen)
5) Upload your .CSR file generated in step 4
6) Apple will sign it, download that file. Open it and It will be added to your Keychain.
7) Go to that certificate on Keychain, right click on it and export it. That file will be a .p12 file. Upload to Firebase under Settings - Cloud Messaging; choose your app and select APNs Certificates. Use the same certificate for Development and Production.
Please let me know if you have any additional questions.
still not working. followed every steps. Do i have to do anything on xcode?
This is interesting. Maybe something else changed. Could you please post the console log you get from Xcode?
2017-08-15 14:37:24.259468-0500 nsatlm[15211:3021455] [DYMTLInitPlatform] platform initialization successful 2017-08-15 14:37:24.398343-0500 nsatlm[15211:3021280] libMobileGestalt MobileGestaltSupport.m:153: pid 15211 (nsatlm) does not have sandbox access for frZQaeyWLUvLjeuE3hmg and IS NOT appropriately entitled 2017-08-15 14:37:24.398486-0500 nsatlm[15211:3021280] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see rdar://problem/11744455)
This not an issue with the repo nor Fuse. Apparently there is a huge thread regarding that specific issue -> https://forums.developer.apple.com/thread/72286
Probably related to certificates or signing. To be honest I don't know but you could try:
1) In Xcode, go to settings, accounts and download all profiles 2) Clean Xcode, cmd + shit + k 3) Close Xcode 4) In Fuse, uno clean and rebuild
Again, not sure what causes it and apparently a lot of users are seeing it. Sorry I can't help much on that area. Send me PM on Fuse's slack, I can give you a hand there.
I'll keep this open until I update it to use Keys instead of Certificates.
Finally, it works. But notification doesn't show up in notification bar. only shows text after running
I'm glad it worked. Could you share your solution for future problems? About the notification, it will only reach the notification center if the app is out of focus. If the app is open the notification will be delivered in a JSON format, then you can create your own notification.
More on that: https://www.fusetools.com/docs/fuse/pushnotifications/push#the-notification
my bad it not working. Works for device with device token only. I tested with NWPusher which was on fusetools docs. I think the APNtoFCM() never runs. Sorry for the confusion
I am confused with this fetch
fetch("https://iid.googleapis.com/iid/v1:batchImport", options) .then(function(response) { return response.json();
Don't we have to add device token before importing? or I am completely lost
I keep getting invalid fcm token even though the above code you provided print out long string of FCM token.
Sorry for the delay. That fetch transforms the Apple Push Notification token and transforms it into Google Cloud messaging token.
Here is more info on that API -> https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens
You can also take a look at the very bottom on that page, there are errors and their definitions.
Hi, Thanks for the info. Is there a way you could run this project again and confirm it still works or not on firebase. If this work for you. I will be sure I messed up somewhere and will work into it. Please
Interesting, I can't get it to work either. Changing this to bug, I will check what's going on. It was working, maybe Firebase changed something (?).
Or maybe I missed something..?
In Notifications.js change line 44 with your api key
Which api key should I use. Server key or legacy server key?
I tried both. It doesn't work. Am I missing something?