katzer / cordova-plugin-local-notifications

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

Crosswalk compability #426

Closed MaZZly closed 9 years ago

MaZZly commented 9 years ago

With crosswalk it doesn't compile if localnotification plugin is used.

APP/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:473: error: cannot find symbol
                    webView.evaluateJavascript(js, null);
                           ^
  symbol:   method evaluateJavascript(String,<null>)
  location: variable webView of type CordovaWebView
APP/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:470: error: cannot find symbol
        webView.post(new Runnable(){
               ^
  symbol:   method post(<anonymous Runnable>)
  location: variable webView of type CordovaWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileArmv7DebugJava'.

I can get rid of compilation errors by removing the sendJavascript function in LocalNotification.java:463 and replacing the 2 calls to it (:419 & :454) with webView.sendJavascript(js);

Then it will compile.. Then when calling cancelAll() or scheduledIds() (And maybe others) the app crashes and output is: [ERROR:runtime_javascript_dialog_manager.cc(69)] Not implemented reached in virtual void xwalk::RuntimeJavaScriptDialogManager::WebContentsDestroyed(content::WebContents*)

Ideas?

danjohnso commented 9 years ago

Agree with @canda, this is really a Cordova 5/Cordova Android 4 issue, not necessarily crosswalk issue. His fix does work (no runtime errors I have seen yet), just need to also delete this jar to fix the compilation error: platforms/android/libs/android-support-v4.jar

bradmartin commented 9 years ago

Do the notifications work with the fix proposed by @canda ?

On Thu, Jun 18, 2015 at 9:47 AM, Dan J notifications@github.com wrote:

Agree with @canda https://github.com/canda, this is really a Cordova 5/Cordova Android 4 issue, not necessarily crosswalk issue. His fix does work (no runtime errors I have seen yet), just need to also delete this jar to fix the compilation error: platforms/android/libs/android-support-v4.jar

— Reply to this email directly or view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/426#issuecomment-113181235 .

danjohnso commented 9 years ago

@bradmartin yup, just finished checking my app, notifications come in with all of the properties

bradmartin commented 9 years ago

@danda1man thanks! I'll use the fix then. Big thanks to @canda for the code.

murilolobato commented 9 years ago

Shouldn't be created a pull request to fix this, and create a new tag in the repository to be used with cordova 5?

ObjectiveTruth commented 9 years ago

Thank you @canda! for the code snipped. It all works now.

This Should really just be updated in a PR

kennedymca commented 9 years ago

not working i have a error cannot resolve method in this line webView.evaluateJavascript(js, null)

behrad commented 9 years ago

+1

flavioalves commented 9 years ago

+1

ants-house commented 9 years ago

+1

HNygard commented 9 years ago

+1

allan-empalmado commented 9 years ago

@canda fix works :)

conchz commented 9 years ago

+1

marcoocram commented 9 years ago

+1

seth100 commented 9 years ago

+1

csvan commented 9 years ago

+1

mblecek commented 9 years ago
hirogasa commented 9 years ago

+1

Crashthatch commented 9 years ago

+1

moshetet commented 9 years ago

Hi had a compliation error with @canda`s fix due to the method sendJavascript expecting only one argument and not the 2nd null parameter that was still left there. I've forked it and fixed it. if anyone is interested: https://github.com/moshetet/cordova-plugin-local-notifications

nerdfiles commented 8 years ago

@canda's solution +1

davidarchanjo commented 8 years ago

Worked for me: https://github.com/sebasi/cordova-plugin-local-notifications on Cordova 5.4.1

lobobobo commented 8 years ago

@canda thank you so much your solution worked for me :) @sharifbdp thank you too for half solution;)

donaldinou commented 8 years ago

+1 We need a new release :P

swswnt commented 8 years ago

how to end schedule notification after particular time(2 hours)??

jQrgen commented 8 years ago

+1

degaray commented 8 years ago

+1

vancentvan commented 8 years ago

Call native app from a web application and then get this error while tabbing back .... [ERROR: runtime_javascript_dialog_manager.cc(69) ] Not implemented reached in virtual void xwalk::RuntimeJavaScriptDialogmanager::ResetDialogState(content::WebContents*)

felixschul commented 8 years ago

@darchanjo I am not surprised that sebasis's plugin compiles, since the relevant lines are just commented out: https://github.com/sebasi/cordova-plugin-local-notifications/blob/master/src/android/LocalNotification.java#L552 I would be surprised if the actual notifications fire through...