katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.56k stars 1.75k forks source link

App not opening when notification is clicked #74

Closed StefanPanait closed 10 years ago

StefanPanait commented 10 years ago

On iOS when the notification is clicked the app will launch. On android (I have tested on nexus 5 and 3 different S2 phones) I get an empty screen.

This is my code:

        var now                  = new Date().getTime(),
        _60_seconds_from_now = new Date(now + 60*1000);
        window.plugin.notification.local.add({ 
                id:         1, // is converted to a string
                title:      'Reminder',
                message:    'Have you completed your anxiety exercise today?',
                date:       _60_seconds_from_now
        });

I don't need it to run any additional functions on click, I just want it to open the app. Sorry if I missed something, please advise.

screenshot_2014-01-26-20-54-57

katzer commented 10 years ago

Which plugin version you are using? Do you use PGB?

StefanPanait commented 10 years ago

I am using PGB.

In my config: gap:plugin name="de.appplant.cordova.plugin.local-notification" So I assume that takes the most recent version.

In PGB I see: de.appplant.cordova.plugin.local-notification 0.6.3 Under 3rd party plugins.

Also in my config: preference name="phonegap-version" value="3.0.0"

Which I believe sets cordova to 3.0

edit: took out tags to make the copied text visible...

katzer commented 10 years ago

Does the problem still exit with v0.7.0?

StefanPanait commented 10 years ago

Hi,

yes it seems to still exist.

I have updated to more recent code and re-built the app such that under plugins it now shows 0.7.0 I also re-installed the app instead of simply updating via hydration, again to no avail.

Edit: added more information

On Wed, Jan 29, 2014 at 4:07 PM, Sebastián Katzer notifications@github.comwrote:

Does the problem still exit with v0.7.0?

Reply to this email directly or view it on GitHubhttps://github.com/katzer/cordova-plugin-local-notifications/issues/74#issuecomment-33630809 .

katzer commented 10 years ago

May you have the possibility to debug the code? I cannot reproduce your described behavior.

Anybody has the same issue with v0.7.x?

StefanPanait commented 10 years ago

I will try. I don't know anything about debugging a running application on the device, I will do some research and let you know.

On Tue, Feb 4, 2014 at 3:07 PM, Sebasti?n Katzer notifications@github.comwrote:

May you have the possibility to debug the code? I cannot reproduce your described behavior.

Anybody has the same issue with v0.7.x?

Reply to this email directly or view it on GitHubhttps://github.com/katzer/cordova-plugin-local-notifications/issues/74#issuecomment-34101145 .

bau720123 commented 10 years ago

@StefanPanait this problem I have been meet before.... well~please let your config.xml like that and rebuild again

<?xml version="1.0" encoding="UTF-8"?>
<widget ....... xmlns:android = "http://schemas.android.com/apk/res/android" ......>

<gap:config-file platform="android" parent="/manifest/application">
 <activity android:launchMode="singleInstance" />
</gap:config-file>

finally use the phonegap build 3.3 and kater's plugin 0.7.0

katzer commented 10 years ago

I havent set the launchmode and its working. Setting the launchmode may prevent the app from restarting but not the black screen.

bau720123 commented 10 years ago

to @katzer and @StefanPanait this is the related issue that I meet https://github.com/katzer/cordova-plugin-local-notifications/issues/30 I just mean if set the launchmode that will all work at every Android version