2016-04-01 11 views
0

私はイオン性フレームワークを使用して1シンプルなアプリを開発して、イオン性の枠組みの中で新たなんです。 午前はリンクの下に、以下、プッシュ通知を実装 https://devdactic.com/android-push-notifications/ は最終段階まで行ってきました:イオンのプッシュ通知)

$ionicPlatform.ready(function() { 
var io = Ionic.io(); 
var push = new Ionic.Push({ 
    "onNotification": function(notification) { 
    alert('Received push notification!'); 
    }, 
    "pluginConfig": { 
    "android": { 
     "iconColor": "#0000FF" 
    } 
    } 
}); 
var user = Ionic.User.current(); 

if (!user.id) { 
    user.id = Ionic.User.anonymousId(); 
} 

// Just add some dummy data.. 
user.set('name', 'Simon'); 
user.set('bio', 'This is my little bio'); 
user.save(); 

var callback = function(data) { 
    push.addTokenToUser(user); 
    user.save(); 
}; 
push.register(callback); 

}); 2Ionicコア: ionic.io.bundle.min.jsのinit:

これは、以下を実行した後は、イオン が

はコンソールで以下のエラー(最後の行を確認してください) イオンのコアを取得-wサファリを提供称賛します:プラグインを模倣しようとしています ionic.io.bundle.min.js:2Ionicコア:プラグインを模倣しようとしています app.js:26TypeError: '未定義'は関数ではありません( 'Ionic.User.anonymousId()'を評価中)

i「は、イオンの情報を」実行した場合の取得次の行

お使いのシステム情報:

コルドバCLI:6.1.0(未定義@コルドバ-LIB) イオンのバージョン:1.2.4 イオンCLIバージョン:1.7.14 イオンのApp Libのバージョン:0.7.0 OS: Windows 7のSP1 ノードのバージョン:V5.0.0


依存性の警告 - CLIは、正しく実行するために、 それは非常にアップグレード/インストールすることが示唆され、次の

インストールしてくださいCordoバージョン> = 4.2.0 npm install -g cordova

答えて

0

The Ionic Platform has now moved to Beta status. Part of this change is the introduction of the Platform API and User authentication. We've deprecated the alpha API for the Users and Push services and will be removing them entirely in the coming months.

にCLIをVAユーザーが今では​​が利用できない、認証が必要です。

Migrationsuser usageを見てください。

+0

Ionicバージョンをベータ状態に更新しました。 – Siva

関連する問題