Coder Social home page Coder Social logo

cordova-notifications-demo's Introduction

cordova-notifications-demo

Meteor app demonstrating the richsilv:cordova-notifications package

USAGE

  1. Clone this repo.
  2. Set up a new Google Project, or enable an existing one for the GCM API by following the instructions here.
  3. Update lib/app.js with the SenderID (Project Number) and GCM API Key you generated in step 2.
  4. Plug in an Android device via USB and enable USB debugging.
  5. Start your app with meteor run android-device.
  6. Navigate to localhost:3000 on your dev machine browser.
  7. Set up a user account on either the Android device or the dev machine browser, and log in to the same account on the other (so that you're logged in on both simultaneously).
  8. Now you should be able to send push notifications from the browser to your android device. They will result in either a UI alert (if the application is open in the Android device) or a notifications tray alert (if it's closed). Note that this is still possible if you unplug the Android device and close the app.

cordova-notifications-demo's People

Contributors

richsilv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cordova-notifications-demo's Issues

Execution failed for task ':compileDebugJava'. after upgrading Meteor to 1.2.0.1

This is the error i get. Do you have any plans to update this for meteor 1.2.0.1

Errors executing Cordova commands:
While running Cordova app for platform Android with options --device:
Error: Command failed: /meteor-meteoric-boilerplate/.meteor/local/cordova-build/platforms/android/cordova/run --device
/meteor-meteoric-boilerplate/.meteor/local/cordova-build/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:495: error: cannot find
symbol
webView.evaluateJavascript(js, null);
^
symbol: method evaluateJavascript(String,)
location: variable webView of type CordovaWebView
/meteor-meteoric-boilerplate/.meteor/local/cordova-build/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java:492: error: cannot find
symbol
webView.post(new Runnable(){
^
symbol: method post()
location: variable webView of type CordovaWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileDebugJava'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    /meteor-meteoric-boilerplate/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
    throw e;
    ^
    Error code 1 for command: /meteor-meteoric-boilerplate/.meteor/local/cordova-build/platforms/android/gradlew with args:
    cdvBuildDebug,-b,/meteor-meteoric-boilerplate/.meteor/local/cordova-build/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
    at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
    at ChildProcess.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:820:12)
    ExitWithCode:1

Thank you,
Solonm

Can it be used in iPhone?

I see in the Usage that it can be used in Android. However, I only have iPhone now.
So my question is, Can it be used in iPhone? Thanks.

Error: Expected fetched plugin to have ID "org.apache.cordova.device" but got "cordova-plugin-device".

Hello. When I try to run « meteor run android-device --mobile-server *.meteor.com », I get this error:

Error while running for mobile platforms: Error running /home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/cordova-scripts/cordova.sh
Failed to install 'de.appplant.cordova.plugin.local-notification':Error: Expected fetched plugin to have ID "org.apache.cordova.device" but got "cordova-plugin-device".
at checkID (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:173:15)
at /home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:94:17
at _fulfilled (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:442:13)
Error: Expected fetched plugin to have ID "org.apache.cordova.device" but got "cordova-plugin-device".
at checkID (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:173:15)
at /home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:94:17
at _fulfilled (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/home/giskard/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:442:13)


Fetching plugin "[email protected]" via plugin registry
Installing "de.appplant.cordova.plugin.local-notification" for android
Fetching plugin "https://github.com/apache/cordova-plugin-device" via git clone

Do you know how to fix that ?
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.