ブラウザでアプリをテストすると、Parse.com データ ブラウザにデータが正常に送信されます。
しかし、「PhoneGap Build」を使用してコンパイルし、(Android エミュレーターまたは Android デバイスから) 実行すると、Parse.com サーバーにデータが送信されず、エラー メッセージが表示されます。
それで、問題はParseではなくPhoneGapに関連している可能性があると思います...?
add: (addeditem) ->
if @mode is "online" #upload to server
Item = Parse.Object.extend("Item");
item = new Item();
console.log "parse item", item
item.save
data: addeditem
,
success: (gameTurnAgain) ->
# The save was successful.
alert "success"
error: (gameTurnAgain, error) ->
# The save failed. Error is an instance of Parse.Error.
alert error.code
alert error.message
console.error(error)
"error.code" と "error.message" を警告しようとすると、それぞれ "-1" (OTHER_CAUSE を意味します) と "未定義" として出力されます。
アプリケーション全体はhttps://github.com/anshula/everydayで入手できます。PhoneGap ビルドはhttps://build.phonegap.com/apps/453542/shareで入手できます。
問題を解決するために PhoneGap Debug を使用してみましたが、エラー メッセージが漠然としているため、本当に混乱しています...助けてくれる人に感謝します!