2015-11-13 29 views
0

我實際上在Ionic中使用PushWoosh,它的工作就像一個魅力!我可以使用PushWoosh儀表板發送Push,我的2設備可以接收它們(Android和iOS)。PushWoosh&Ionic - 在Firebase中保存用戶設備標記

的問題開始,當我想保存device_token進入火力地堡的用戶,我會試試這個:

pushNotification.getPushToken(
    function(status) 
     { 
    var deviceToken = status['deviceToken']; 
    $scope.deviceToken = deviceToken; 
     userRef.child(authResponse.userID).update({ device_token: $scope.deviceToken }) 
     } 
    ); 

但我有錯誤消息:

Uncaught TypeError: Cannot read property 'pushNotification' of undefined

當我勞克應用我的電話,我可以看到Device_Token,但我想將他保存在Firebase中...

請幫忙!

謝謝大家!

回答

0

你忘了初始化pushNotification變量嗎?