Giter Club home page Giter Club logo

Comments (9)

gongfan99 avatar gongfan99 commented on July 20, 2024 1

@macdonst Thanks. It works nicely with phonegap build.

Just to benefit anyone who has the same issue and ends up here. What I did wrong was that I should manually bootstrap Angular in the "deviceready" callback, like this:

angular.module("myApp", [ ... ]);

angular.element(document).ready(function () {
    if (window.cordova) {
        document.addEventListener('deviceready', function () {
            angular.bootstrap(document, ['myApp']);
        }, false);
    } else {
        angular.bootstrap(document, ['myApp']);
    }
});

And the "ng-app" tag need to be removed from the index.html to prevent auto bootstrap.

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@FernandoMedin that's not the correct plugin ID. The plugin ID for this package is "phonegap-plugin-push". If you are running the PhoneGap 5.0 command line then doing a:

phonegap pluging add phonegap-plugin-push

it will setup your config.xml for you. Let me know if this doesn't resolve things for you.

from phonegap-plugin-push.

FernandoMedin avatar FernandoMedin commented on July 20, 2024

@macdonst thanks for the reply! But, I'm getting the same error. I just tested using phonegap-build. Should I use the command line to build the app?
At this time I just ran the command line in a new project and edit index.js to put the "Try".

Thanks.

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@FernandoMedin I don't think the plugin has been uploaded to PhoneGap Build. If you are using PhoneGap/Cordova CLI 5+ then:

phonegap create pushtest
phonegap platform add android
phonegap plugin add phonegap-plugin-push
// edit the html/js
phonegap run android

Substitue ios for android if you want to test iOS.

from phonegap-plugin-push.

FernandoMedin avatar FernandoMedin commented on July 20, 2024

@macdonst, that works! The problem was with phonegap build so. Anyway, thank you very much! Any ideia if the plugin will be available in phonegap build?

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@FernandoMedin I'm going to close this issue then as you have a work around. I'm off this week but putting in a few bug fixes as I have time. Hope to have the next version on PG Build be early next week. I'll create an issue for it.

from phonegap-plugin-push.

gongfan99 avatar gongfan99 commented on July 20, 2024

Is this module in phonegap build yet? I have tried phonegap build and PushNotification is undefined.

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@gongfan99 https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PHONEGAP_BUILD.md

from phonegap-plugin-push.

lock avatar lock commented on July 20, 2024

This thread has been automatically locked.

from phonegap-plugin-push.

Related Issues (20)

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.