Closed Morgul closed 8 years ago
I got issues with push notification under iOS. When i have a look into mongo there is an token for my device in the collection "_raix_push_app_tokens", but no "userId" is assigned to it. It's null. It seems, there is no update to the device-token after login.
Possibly https://github.com/RocketChat/Rocket.Chat/commit/bf0008f820d7111906a738dcf14aa4b1fe27b37c broke it.
@morgul: Have you tried adding a file called "_www/js/android_sender_id.js_" to your Cordova-Project with content like
window.ANDROID_SENDER_ID = "XXXXXXXXXX";
I was getting an error that it was missing in my project after a _git pull_ and _cordova prepare_
@pschonder I'm not building the Cordova app myself, I'm using the beta published on the Android Store. I strongly support a single application that can connect to any instance of Rocket.Chat, and as such have avoided building the app myself.
@rodrigok have you seen my comment?
@Morgul we will investigate that.
@pschonder are you trying with iOS or Android?
@rodrigok I'm using a self built iOS app with my own server. The iOS-App is built with my own Provisioning-Profile and my own Certificate added to the Server Push Settings for APN. If I update the collection-entry in "_raix_push_app_tokens" and change the field userId from "null" to my userId the Push-Notification is delivered to my device. It seems there's something broken when updating the registered device-Token with the user which is logging in.
Is it possible https://github.com/RocketChat/Rocket.Chat/commit/bf0008f820d7111906a738dcf14aa4b1fe27b37c broke it?
After some further investigation i noticed some strange behavior:
After the App is synced with the server the Client-Token is saved in the collection:
Push: Settings userId "null" for app: sebjtoMBBysMYb3ej
CLIENT token [ { apn: '16cb78dee0f3849e9fdefc744f9523716e82246f4d670fc7d4310486e0078dfc' } ]
Push: Got push token from app: { id: 'sebjtoMBBysMYb3ej',
token: { apn: '16cb78dee0f3849e9fdefc744f9523716e82246f4d670fc7d4310486e0078dfc' },
appName: 'main',
userId: null,
metadata: {} }
Push: updated { token: { apn: '16cb78dee0f3849e9fdefc744f9523716e82246f4d670fc7d4310486e0078dfc' },
appName: 'main',
userId: null,
enabled: true,
createdAt: Wed Dec 02 2015 18:42:04 GMT+0100 (CET),
updatedAt: Wed Dec 02 2015 18:42:04 GMT+0100 (CET),
_id: 'sebjtoMBBysMYb3ej' }
When i finish the login the Client-Token is not updated. I stopped the App with x-code and startet it again:
Push: Settings userId "z8sLJTnuBY4b367jR" for app: sebjtoMBBysMYb3ej
CLIENT token [ { apn: '4a1ff3ed573953504d8c02d0c9162dc47c046049abf9e064459e1fc8baf5b0cc' } ]
Push: Got push token from app: { id: 'sebjtoMBBysMYb3ej',
token: { apn: '4a1ff3ed573953504d8c02d0c9162dc47c046049abf9e064459e1fc8baf5b0cc' },
appName: 'main',
userId: 'z8sLJTnuBY4b367jR',
metadata: {} }
Push: updated { _id: 'sebjtoMBBysMYb3ej',
token: { apn: '16cb78dee0f3849e9fdefc744f9523716e82246f4d670fc7d4310486e0078dfc' },
appName: 'main',
userId: 'z8sLJTnuBY4b367jR',
enabled: true,
createdAt: Wed Dec 02 2015 18:42:04 GMT+0100 (CET),
updatedAt: Wed Dec 02 2015 18:42:04 GMT+0100 (CET) }
The token is updated now. This is not the right behavior in my opinion.
and there is another strange behavior: The badge "1" at the app icon is not cleared when all messages were read.
@rodrigok is there any progress on this issue. Can you confirm the problems?
Yes, I did some changes 2 days ago, I need to do a new test.
@pschonder, can you test these changes too?
@rodrigok seems to be working now. The Badge with "1" is still there, even when all messages are read or when there are more than one unread message.
Ok, I will take a look, thanks
@pschonder was fixed in our server code on branch develop.
@rodrigok how did you get this fixed? It is definately the biggest issue we have with iOS.
@russcalderon What is your issue? Which version are you using of mobile and server? Do you receive notifications when you click to test?
@rodrigok the rocketchat server ver. 0.35.0 and iOS 9.3.3. I do get the notifications just fine. We are just not able to get clear the 1 count message badge. If i exit the application it will clear it but them it will be ok until it gets stuck again. We are primarily iOS users but those with androids are clearing just fine.
@Rodrigok you know actually issue #3618 is more relevant than this ticket, i have posted a comment on it.
@russcalderon is this still an issue for you with the count on the app badge not resetting?
I'm attempting to get push notifications working, and after figuring out what seems to be a correct setup, I still don't get push notifications. Checking the console when the cordova client connects, I see this in the logs:
For posterity, here is my configuration:
Is this a problem with the latest beta, or maybe my configuration?