Coder Social home page Coder Social logo

Comments (7)

imhoffd avatar imhoffd commented on May 28, 2024

register() takes no arguments. What error are you getting?

from legacy-ionic-cloud.

Alkasih avatar Alkasih commented on May 28, 2024

The options argument is required

And it occured in the line of $ionicPush.register.

from legacy-ionic-cloud.

Alkasih avatar Alkasih commented on May 28, 2024

This is my full code

$ionicAuth.signup(detailedLogin).then(function(newUser)  {
   var options = {'remember' : true};

    $ionicAuth.login('basic', detailedLogin, options).then(function() {

        $ionicPush.register().then(function(token) {
              console.log("My Device tokensss:",token.token);
              return $ionicPush.saveToken(token); 
         });

from legacy-ionic-cloud.

Alkasih avatar Alkasih commented on May 28, 2024

Unhandled rejection Error: The options argument is required.
at new PushNotification (file:///android_asset/www/plugins/phonegap-plugin-push/www/push.js:27:15)
at Object.module.exports.init (file:///android_asset/www/plugins/phonegap-plugin-push/www/push.js:260:16)
at file:///android_asset/www/lib/ionic.cloud.min.js:1:31247
at t.once (file:///android_asset/www/lib/ionic.cloud.min.js:1:24550)
at t.register (file:///android_asset/www/lib/ionic.cloud.min.js:1:31177)
at file:///android_asset/www/js/services/common/auth.js:290:40
at r (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:31:7722)
at i._settlePromiseFromHandler (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:30:13044)
at i._settlePromise (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:30:13847)
at i._settlePromise0 (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:30:14548)
at i._settlePromises (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:30:15878)
at r._drainQueue (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:29:3148)
at r._drainQueues (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:29:3209)
at drainQueues (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:29:1238)
at MutationObserver. (http://cdn.jsdelivr.net/bluebird/3.4.1/bluebird.min.js:30:29699)

from legacy-ionic-cloud.

Alkasih avatar Alkasih commented on May 28, 2024

It always said that GCM project number is not found.

I have set it up here:


.config(function($ionicCloudProvider) {
  $ionicCloudProvider.init({
    "core": {
      "app_id": "YOUR-APP-ID",
      "sender_id": "GCM Number"
    }
  });
})

I also have tried "gcm_key": "GCM Number"

But none of them fix that.

I even have tried to re-run ionic config set gcm_key <your-gcm-project-number>

from legacy-ionic-cloud.

Alkasih avatar Alkasih commented on May 28, 2024

The documentation is not fully describing how to set it, untill I followed the commit message and found this:

      'core': {
        'app_id': '1234abc'
      },
      'push': {
        'sender_id': 'sender_id_123'
      }

from legacy-ionic-cloud.

imhoffd avatar imhoffd commented on May 28, 2024

@Alkasih You're using an undocumented beta version, as the Migration Guide says at the top. This won't be the first thing you encounter that's different between the cloud client and ionic-platform-web-client.

Our new documentation is coming soon.

For now, I've updated the config example to include that config format.

from legacy-ionic-cloud.

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.