發表文章

目前顯示的是有「Firebase」標籤的文章

iOS Push Notification Notes

UIApplication https://developer.apple.com/documentation/uikit/uiapplication/   registerForRemoteNotifications() https://developer.apple.com/documentation/uikit/uiapplication/1623078-registerforremotenotifications If registration succeeds, the app calls your app delegate object’s application(_:didRegisterForRemoteNotificationsWithDeviceToken:) method and passes it a device token.

191029 Firebase Task continueWith

這幾天在看 Firebase 的 Call functions from your app https://firebase.google.com/docs/functions/callable 範例中,有一段程式碼如下 return functions .getHttpsCallable( "addNumbers" ) .call(data) .continueWith { task -> // This continuation runs on either success or failure, but if the task // has failed then task.result will throw an Exception which will be // propagated down. val result = task. result ?. data as Map<String, Any> result[ "operationResult" ] as Int }   functions com.google.firebase.functions.FirebaseFunctions https://firebase.google.com/docs/reference/android/com/google/firebase/functions/FirebaseFunctions  .getHttpsCallable( "addNumbers" )   "addNumbers" 為 Cloud Function 的名稱 getHttpsCallable 回傳的是 HttpsCallableReference https://firebase.google.com/docs/reference/android/com/google/firebase/functions/HttpsCallableReference.html .call(data) 傳入的是 addNumbers 可接受的...