- (void)startXGWithAccessID:(uint32_t)accessID accessKey:(nonnull NSString *)accessKey delegate:(nullable id<XGPushDelegate>)delegate;
[[XGPush defaultManager] startXGWithAccessID:<your AccessID> accessKey:<your AccessKey> delegate:self];
startXGWithAccessID:accessKey:delegate: 方法重启腾讯移动推送服务。- (void)stopXGNotification;
[[XGPush defaultManager] stopXGNotification];
@property (copy, nonatomic, nullable, readonly) NSString *xgTokenString;
NSString *token = [[XGPushTokenManager defaultTokenManager] xgTokenString];
- (void)xgPushDidRegisteredDeviceToken:(nullable NSString *)deviceToken xgToken:(nullable NSString *)xgToken error:(nullable NSError *)error
- (void)xgPushDidFailToRegisterDeviceTokenWithError:(nullable NSError *)error
- (void)xgPushDidRequestNotificationPermission:(bool)isEnable error:(nullable NSError *)error;
- (void)upsertAccountsByDict:(nonnull NSDictionary<NSNumber *, NSString *> *)accountsDict;
XGPushTokenAccountType accountType = XGPushTokenAccountTypeUNKNOWN;NSString *account = @"account";[[XGPushTokenManager defaultTokenManager] upsertAccountsByDict:@{ @(accountType):account }];
upsertAccountsByDict:@{@(1002):@"具体手机号"}。- (void)upsertPhoneNumber:(nonnull NSString *)phoneNumber;
[[XGPushTokenManager defaultTokenManager] upsertPhoneNumber:@"13712345678"];;
delAccountsByKeys:[[NSSet alloc] initWithObjects:@(1002), nil]- (void)delAccountsByKeys:(nonnull NSSet<NSNumber *> *)accountsKeys;
XGPushTokenAccountType accountType = XGPushTokenAccountTypeUNKNOWN;NSSet *accountsKeys = [[NSSet alloc] initWithObjects:@(accountType), nil];[[XGPushTokenManager defaultTokenManager] delAccountsByKeys:accountsKeys];
- (void)clearAccounts;
[[XGPushTokenManager defaultTokenManager] clearAccounts];
- (void)appendTags:(nonnull NSArray<NSString *> *)tags- (void)delTags:(nonnull NSArray<NSString *> *)tags
//绑定标签:[[XGPushTokenManager defaultTokenManager] appendTags:@[ tagStr ]];//解绑标签[[XGPushTokenManager defaultTokenManager] delTags:@[ tagStr ]];
- (void)clearAndAppendTags:(nonnull NSArray<NSString *> *)tags
[[XGPushTokenManager defaultTokenManager] clearAndAppendTags:@[ tagStr ]];
- (void)clearTags
[[XGPushTokenManager defaultTokenManager] clearTags];
- (void)queryTags:(NSUInteger)offset limit:(NSUInteger)limit;
[[XGPushTokenManager defaultTokenManager] queryTags:0 limit:100];
- (void)xgPushDidQueryTags:(nullable NSArray<NSString *> *)tags totalCount:(NSUInteger)totalCount error:(nullable NSError *)error;
- (void)upsertAttributes:(nonnull NSDictionary<NSString *,NSString *> *)attributes
[[XGPushTokenManager defaultTokenManager] upsertAttributes:attributes];
- (void)delAttributes:(nonnull NSSet<NSString *> *)attributeKeys
[[XGPushTokenManager defaultTokenManager] delAttributes:attributeKeys];
- (void)clearAttributes;
[[XGPushTokenManager defaultTokenManager] clearAttributes];
- (void)clearAndAppendAttributes:(nonnull NSDictionary<NSString *,NSString *> *)attributes
[[XGPushTokenManager defaultTokenManager] clearAndAppendAttributes:attributes];
- (void)setBadge:(NSInteger)badgeNumber;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {/// 每次启动 App 应用角标清零(本地应用角标设置需要在主线程执行)if ([XGPush defaultManager].xgApplicationBadgeNumber > 0) {[XGPush defaultManager].xgApplicationBadgeNumber = 0;}return YES;}- (void)xgPushDidRegisteredDeviceToken:(nullable NSString *)deviceToken xgToken:(nullable NSString *)xgToken error:(nullable NSError *)error {/// 在注册完成后同步角标数到 TPNSif (!error) {[[XGPush defaultManager] setBadge:0];}}
- (void)deviceNotificationIsAllowed:(nonnull void (^)(BOOL isAllowed))handler;
[[XGPush defaultManager] deviceNotificationIsAllowed:^(BOOL isAllowed) {<#code#>}];
- (nonnull NSString *)sdkVersion;
[[XGPush defaultManager] sdkVersion];
- (void)uploadLogCompletionHandler:(nullable void(^)(BOOL result, NSString * _Nullable errorMessage))handler;
[[XGPush defaultManager] uploadLogCompletionHandler:nil];
- (void)xgPushLog:(nullable NSString *)logInfo;
Doc Feedback