-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Not receiving property "tap" IOS #61
Comments
Same problem here |
I'm not able to reproduce this issue when testing using the example project with the latest version ( This screen capture shows the This screen capture shows a notification message sent from the Firebase Console with the In both, there a 3 scenarios illustrated:
As you'll see, in all situations the I would urge you to repeat the same tests as above by building and running the example project and report your results here. |
Hi @dpa99c, thank you so much for the feedback so quickly. I will make some investigations and let you know. I believe you can close the issue for now. |
@mateusduraes use this body https://github.com/dpa99c/cordova-plugin-firebasex-test/blob/master/messages/notification.json, i had the same problem for iOS but using this body fixed and now it works |
@mateusduraes thanks for the update. will close for now. |
Hi, after some debug i realize that i still not receiving the property {
"topic": "1289_1352",
"notification": {
"body": "Be Member: Hello guys",
"title": "Be Member"
},
"android": {
"priority": "normal",
"ttl": 3600,
"notification": {
"sound": "default",
"color": "#0099ff",
"icon": "fcm_push_icon"
}
},
"apns": {
"payload": {
"aps": {
"badge": 1,
"sound": "default"
}
}
},
"data": {
"ownerName": "Be Member",
"ownerPicture": "https://be-api-production.s3.eu-central-1.amazonaws.com/production/upload/user_image_upload/99557/upload",
"chatMessage": "Hello guys",
"type": "new_message",
"channelId": "1289_1352",
"messageId": "M6f4bR9x7m0VCmsK61pL"
}
} In my application I received the following in "onMessageReceived" callback aps: {alert: {title: "Be Member", body: "Be Member: Hello guys"}, badge: 1, sound: "default"}
channelId: "1289_1352"
chatMessage: "Hello guys"
gcm.message_id: "1564425263106447"
google.c.a.e: "1"
messageId: "M6f4bR9x7m0VCmsK61pL"
messageType: "notification"
ownerName: "Be Member"
ownerPicture: "https://be-api-production.s3.eu-central-1.amazonaws.com/production/upload/user_image_upload/99557/upload"
type: "new_message" When I send the push-notification using a script in your test project, with the following command, npm run-script send -- --message=notification.json --token="cyue3zCM58o:APA91bGeOiciQhMlcAie--Np35CtYiTtZqtpxKUQyT97ahROTeIK5Q8aBjcCyg_lY2wHA5vyRc1zJumUGIWsp4-aCqM2d7sdI4wd6BrxRO1SbfeMTa7iSAXeTPJiSf1596xE3SqKGNuZ" My app crashes and i see the following log in my xcode 2019-07-29 15:44:11.947966-0300 My Runcard[2820:858944] didReceiveRemoteNotification: {
aps = {
alert = {
body = "Notification with default settings";
title = "Default Notification";
};
badge = 1;
sound = default;
};
"gcm.message_id" = 1564425851513033;
"google.c.a.e" = 1;
"key_1" = "Data for key one";
messageType = notification;
"notification_foreground" = true;
}
2019-07-29 15:44:11.953574-0300 My Runcard[2820:859023] -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xd900dc6a1b315eeb
2019-07-29 15:44:11.954552-0300 My Runcard[2820:859023] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xd900dc6a1b315eeb'
*** First throw call stack:
(0x1ac65d27c 0x1ab8379f8 0x1ac579ab8 0x1ac662ac4 0x1ac66475c 0x102299634 0x10312b6f0 0x10312cc74 0x103134bf4 0x1031358ec 0x10313f77c 0x1ac27d114 0x1ac27fcd4)
libc++abi.dylib: terminating with uncaught exception of type NSException Am i doing something wrong? I'm sorry |
What are you using as backend? Either add tap manually and modify it. |
Hi @jakupi1 , I'm using NodeJS (Firebase Cloudfunctions), i can easily add the property |
I've tried to set a default value to property I'll be waiting for @dpa99c suggestions, so I can investigate more. |
@dpa99c It only works when I put the following instruction on line 132 of AppDelegate+FirebasePlugin.m: [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"]; So, now, I'm able to receive the property tap as a boolean. This make any sense? |
@mateusduraes just to confirm - in your scenario, is the call to
|
I got the similar issue in my project but not in the example project as well. On iOS, when I set "notification_foreground" to "true",
So the next thing I tried is to remove the "notification_foreground" attribute. On iOS, when I send a notification without the "notification_foreground" attribute, my app won't crash when a notification arriving either in foreground, background or not running. Thanks for the help! |
Reopening as there's obviously some underlying issues here. One thing I will do is add top-level exception handling for iOS (like I've done for Android) to prevent app crashes. @mateusduraes With regard to the cause of your crash, I suspect the problem is the sound attribute. In your crashlog I see the sound value is shown as @freddysu with regard to the |
Thanks for the quick reply. Sorry for the incorrect description above. I've edited my comment:) |
|
Although it may be another problem, my ios terminal could not receive system notification at foreground time. ("Notification_foreground" = true) The version is "cordova-plugin-firebasex 6.0.2". |
@shinwenli You are right! Thanks for your feedback. If I removed the "FirebasePlugin.grantPermission()", it works perfect on iOS. Now I just call "getPermission" the first time after the app is installed, which means only at the first time when the user opens the app, grant the permission and then if there is a notification arrives will crash the app. After the user restarts the app, it works perfectly in "foreground", "background" and "not running" even with the "notification_foreground" attribute on iOS. |
I had the same problem. In my app, call hasPermission then call grantPermission. This problem occurred because I changed the plugin of the app from "cordova-plugin-firebase" to "cordova-plugin-firebasex". thank you @shinwenli, @dpa99c |
Definitely solved for me by making sure grantPermission was not called unless hasPermission returns false... all worked after that! Thanks |
…turn an error (rather than attempting to grant permission again which causes issues). See #61
…ected exceptions in order to prevent app crashes. Log exceptions to native and JS consoles. See �#61.
I have the same problem(notifications work only after restarting the app), has the last commit solved the issue? |
Same problem with my project :( |
I've just published v6.0.3 which should address the multiple problems captured in this issue. |
Hi, I'm using v6.0.6 and still there is a problem with the tap property on iOS. Steps to reproduce:
However, if I close the app completely and open it again, since I don't call grantPermission again, I recevie the tap property when tapping on the system notification. So the problem is still present, when calling grantPermission. |
Same problem |
Same here, I get tap property only if app is completely closed when clicking on notification |
I was able to solve this problem with Version 6.1.0. Thank you @dpa99c. |
Hi
This plugins seems to work fine. I'm testing my app IOS app in development mode.
I receive the notifications that i send from firebase console, but, when the app is closed and I tap the notification, the app opens but there is no information about the property
tap.
Those are the only informations that I receive
Can someone give me help?
The text was updated successfully, but these errors were encountered: