Skip to main content

updateFcmToken

Function Introduction

Note

Updates the Firebase user token on the IM server.

Warning

(1) This interface is used to set or refresh the Firebase user token. An expiration time can be specified, and it is only effective when the server's offline push is set to Firebase.

Function Prototype


- (void)updateFcmToken:(NSString *)fcmToken
expireTime:(NSInteger )expireTime
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeRequiredDescription
fcmTokenNSStringYesFCM Token
expireTimeintYesFCM Token expiration time, in seconds

Return Result

NameTypeDescription
onSuccessOIMSuccessCallbackSuccess return
onFailureOIMFailureCallbackFailure return

Code Example


[OIMManager.manager updateFcmToken:@""
expireTime:
onSuccess:^(NSString * _Nullable data) {

} onFailure:^(NSInteger code, NSString * _Nullable msg) {

}];