-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Firebase Notification for iOS is not working #463
Comments
Hi i'm not following what the issue is? Can you point out the FCM bugs, i'm not aware of those. Also only our test flight builds are using FCM, the production app is still using direct APNS, which we plan on deprecating very soon with the next release. Also note in the code you are referencing, that our test flight build's registrations are included in that |
@digitaldan im looking at the current GitHub source code and probably has not been implemented yet in production. Anyway, the problem happens when we use this updated source on our private cloud instance as it uses sendIosNotification via APNS route BUT Openhab IOS app may not update a valid iosdeviceToken into openhabcloud userdevices table/collection. |
I'm still not following, are you running your own build of the IOS client ? And if so are you running the latest |
If the direction is going toward pure FCM for both IOS and Android, and the code will be cleaned up till then, then i think no problem. But i just want to highlight the following piece of code in current OpenHAB IOS App:
If i read it correctly, the fcmToken will be updated into openhabcloud userdevices table/collection's iosDeviceToken field in subsequent calls. If we use use APNS routines in openhabcloud to send notification message instead of FCM to IOS devices, we will get "Bad token" error from the aps2 sendmessage function, because the uploaded token is FCM token and not Apple's APNS token. |
No, it will be a fcm device token, iosDeviceToken is for the APNS connection we plan on removing in a few months once the new app is out and enough time has passed that user's upgrade. The IOS app with FCM uses a different registration API endpoint on openHAB cloud. |
I have looked through openhabcloud code and also openhab-ios. One i think realise is that the openhab-ios rely on the following code in AppDelegate.swift to eventually register IOS device token into OpenHAB-Cloud's device DB. Problem is, the following code does not always get called for some bugs related to FCM SDK (search the internet) and it is the google's Messaging device token being registered which will break the apns2 module.
Instead, i suggest to bypass apns2 module, and just let google-firebase to handle all the messages routing to IOS devices. Therefore, the following is a snippet changes that i propose in socket-io.js:
The text was updated successfully, but these errors were encountered: