ios - Ionic Push - not getting token on device -


i can't seem ionic push work, last 3 days have done "push scratch" , ios setup tutorials on , over.

i can send dev pushes device - show fine alerts, when switch send pushes via apn using development certificate things go wrong. using log can see $cordovapush.register fails in way, strangely enough not write errors (or success messages matter) xcode console. see snippet below:

if (app.dev_push) {...} else {  console.log('before');                 $cordovapush.register(config).then(function (token) {                     console.log('$ionicpush:registered', token);                      defer.resolve(token);                      if (token !== 'ok') {                          $rootscope.$emit('$cordovapush:tokenreceived', {                             token: token,                             platform: 'ios'                         });                          // push token user data                         try {                             $ionicuser.push('_push.ios_tokens', token, true);                         } catch (e) {                             console.warn('received push token before user identified , not synced ionic.io. make sure call $ionicuser.identify() before calling $ionicpush.register.');                         }                     }                 }, function (err) {                     console.error('$ionicpush:register_error', err);                 });                 console.log('after'); 

and here log:

2015-07-20 20:13:23.530 passionapp[4419:727003] diskcookiestorage changing policy 2 0, cookie file: file:///private/var/mobile/containers/data/application/686516fa-fa77-4d78-ae1b-08a245d0c06f/library/cookies/cookies.binarycookies 2015-07-20 20:13:24.170 passionapp[4419:727003] apache cordova native platform version 3.8.0 starting. 2015-07-20 20:13:24.174 passionapp[4419:727003] multi-tasking -> device: yes, app: yes 2015-07-20 20:13:24.200 passionapp[4419:727003] unlimited access network resources 2015-07-20 20:13:24.618 passionapp[4419:727003] [cdvtimer][keyboard] 0.677943ms 2015-07-20 20:13:24.619 passionapp[4419:727003] init facebookconnect session 2015-07-20 20:13:24.659 passionapp[4419:727003] [cdvtimer][facebookconnectplugin] 39.842010ms 2015-07-20 20:13:24.660 passionapp[4419:727003] [cdvtimer][totalpluginstartup] 42.838991ms 2015-07-20 20:13:25.639 passionapp[4419:727003] active 2015-07-20 20:13:25.734 passionapp[4419:727003] attempting badge application icon haven't received permission user badge application 2015-07-20 20:13:26.277 passionapp[4419:727003] resetting plugins due page load. 2015-07-20 20:13:27.918 passionapp[4419:727003] finished load of: file:///private/var/mobile/containers/bundle/application/3bb4429c-2615-4136-a122-7496c351917c/passionapp.app/www/index.html#/app/intro  2015-07-20 20:13:29.641 passionapp[4419:727003] thread warning: ['device'] took '15.608154' ms. plugin should use background thread.  2015-07-20 20:13:29.904 passionapp[4419:727003] thread warning:  ['pushplugin'] took '33.658936' ms. plugin should use background thread.  2015-07-20 20:13:29.907 passionapp[4419:727003] before  2015-07-20 20:13:29.908 passionapp[4419:727003] after 

i realise apn call may async, last entry in log.

i using xcode 6.4, test device iphone 4s running latest released ios.

i fixed it. reason xcode project did´t use right provision profile, deleted , startet on - did trick.


Comments