Closed tomshabtay closed 6 years ago
I managed to fix it by using this code from the demo app.
application.on(application.resumeEvent, function (args) {
if (args.android) {
const act = args.android;
const intent = act.getIntent();
const extras = intent.getExtras();
console.log("Resuming activity");
if (extras) {
console.log("If your notification has data (key: value) pairs, they will be listed here:");
const keys = extras.keySet();
const iterator = keys.iterator();
while (iterator.hasNext()) {
const key = iterator.next();
console.log(key + ": " + extras.get(key).toString());
// clear the used keys in order to avoid getting them back
// when manually switching the application between background and foreground
intent.removeExtra(key);
}
}
}
});
If you managed to fix the case would you close the issue?
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
CLI: 3.4.3
Cross-platform modules: 3.4.1
Runtime(s): tns-ios version: "3.4.1" tns-android version": "3.4.2"
Plugin(s):
Please, tell us how to recreate the issue in as much detail as possible.
I am trying to invoke a callback function after the notification is been clicked (and the app is on background).
i used this code in order to get the notification from the intent like in the documentation:
instead of seeing keys related to the notification in the logs i see a list of methods:
Is it what i'm supposed to see or something in my implementation isn't right?
Thanks, Tom