caffeinalab / ti.goosh

GCM/FCM module for Titanium.
MIT License
52 stars 34 forks source link

Android issue when close app #51

Closed quocbao1087 closed 7 years ago

quocbao1087 commented 7 years ago

Hi, I have an issue. When I press Home button to view phone's home screen. Click on notification > app open detail page. But when I close app > click notification > only open app, not open detail page. Can you please help on this?

hannta commented 7 years ago

I have similar issue.

When the app is in foreground, I receive the notification, callback is executed correctly with the data.

If the app is closed or in background, I click the notification, callback not get called.

Using TiSDK 6.0.4.GA & ti.goosh 2.0.6, FCM (node-pushnotifications / node-gcm) for sending notifications.

progress44 commented 7 years ago

As discussed in previous issues, if you are using FCM, make sure to not use notification.

The notification object behaves like (quote): "FCM automatically displays the message to end-user devices on behalf of the client app. Notification messages have a predefined set of user-visible keys and an optional data payload of custom key-value pairs."

Use only data. Check out the documentation on how to send the payload correctly.

quocbao1087 commented 7 years ago

HI, I am using GCM and push notification data same as document page: https://github.com/caffeinalab/ti.goosh - A PHP/Shell Example

progress44 commented 7 years ago

@quocbao1087 which version of ti.goosh are you using and what device are you testing it on?

quocbao1087 commented 7 years ago

I am using TiSDK 6.0.4.GA & ti.goosh 2.0.6 I am testing on Samsung Galaxy A5 2016. Android 6.0.1

When the app is in foreground, I receive the notification, callback is executed correctly with the data. If the app is closed, I click the notification, callback not get called.

progress44 commented 7 years ago

Some devices require particular permissions from the user. What device are you using?

hannta commented 7 years ago

@progress44 im setting the data as data object. Im able to get data correctly when the app is in foreground, so I quess the issue is not in data it self?

My device Nexus 5.

progress44 commented 7 years ago

@hannta whether data is correct or not is irrelevant if you include notification because FCM will only consider notification

quocbao1087 commented 7 years ago

I am using TiSDK 6.0.4.GA & ti.goosh 2.0.6 I am testing on Samsung Galaxy A5 2016. Android 6.0.1

When the app is in foreground, I receive the notification, callback is executed correctly with the data. If the app is closed, I click the notification, callback not get called.

progress44 commented 7 years ago

I'll check this out but it has been tested before.

hannta commented 7 years ago

Thanks @progress44, my issue was because incorrect data (im using FCM).

mitulbhalia commented 6 years ago

Hi @hannta Can you please provide your solution for this issue?

My issue is that callback is not called when app is completely closed. In all other aspects, it works well.