SHARE
TWEET

Untitled

a guest Jan 21st, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     func createToken(){
  2.         let instance = InstanceID.instanceID()
  3.         instance.deleteID { (error) in }
  4.         InstanceID.instanceID().instanceID { (result, error) in
  5.             if let error = error {
  6.                 print(error)
  7.                
  8.             }else if let result = result {
  9.                 print(result.token)
  10.                
  11.                 //Using new token the create an message with Firebase Cloud functions
  12.                 Messaging.messaging().shouldEstablishDirectChannel = true
  13.             }
  14.            
  15.         }
  16.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top