ios推送通知停止快速运行

时间:2018-07-04 11:32:46

标签: ios quickblox

-(void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {  

    NSString *dt = [[credentials.token description]stringByTrimmingCharactersInSet:
    [NSCharacterSet characterSetWithCharactersInString:@"<>"]];
    dt = [dt stringByReplacingOccurrencesOfString:@" " withString:@""];
    NSLog(@"My token is: %@", dt);

    if([credentials.token length] == 0) {
        NSLog(@"voip token NULL");

        NSString *dt =@"123456";
        NSLog(@"Error token is: %@", dt);
        [UserDefaults setObject:dt forKey:NS_device_id];
        return;
    }

    NSLog(@"PushCredentials: %@", credentials.token);

    [UserDefaults setObject:dt forKey:NS_device_id];

    NSString *deviceIdentifier = [[[UIDevicecurrentDevice]identifierForVendor] UUIDString];

    QBMSubscription *subscription = [QBMSubscription subscription];
    subscription.notificationChannel = QBMNotificationChannelAPNSVOIP;
    subscription.deviceUDID = deviceIdentifier;
    subscription.deviceToken = [self.voipRegistry pushTokenForType:PKPushTypeVoIP];

    [QBRequest createSubscription:subscription successBlock:^(QBResponse *response, NSArray *objects) {
        NSLog(@"Create Subscription request - Success");
    } 
    errorBlock:^(QBResponse *response) {
        NSLog(@"Create Subscription request - Error");
    }];
}

-(void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
    NSLog(@"didReceiveIncomingPushWithPayload");
}

-(void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(PKPushType)type {
    NSString *deviceIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

    [QBRequest unregisterSubscriptionForUniqueDeviceIdentifier:deviceIdentifier successBlock:^(QBResponse * _Nonnull response) {
        NSLog(@"Unregister Subscription request - Success");
    } 
    errorBlock:^(QBError * _Nonnull error) {
        NSLog(@"Unregister Subscription request - Error");
    }];
}

3 个答案:

答案 0 :(得分:1)

即使从quickblox管理面板发送,

推送通知也完全不起作用。 甚至无法将票证提交到quickblox服务。

答案 1 :(得分:1)

我很确定他们没有通过APNS的最新更改在设备中的服务器上进行过更改,这不是客户端代码。他们的支持没有答案,奇怪的事情还在发生。

答案 2 :(得分:0)

其管理服务器https://admin.quickblox.com/的服务器正在维护中 很抱歉给用户带来一个博客的消息,该博客的博客最后一帖是两天前。当新用户尝试登录时,我的ios应用会给出其api中生成的异常。 他们的电话线上也无人接听。 看起来不好...