Atulkumar V. Jain
Atulkumar V. Jain

Reputation: 5098

Devicetoken of iphone for push notification?

I have tried PushMeBaby as server. The problem which I am facing is that the Push notification gets activated as when the app launches it prompts me to connect to itunes for push notification, but neither the

didRegisterForRemoteNotificationsWithDeviceToken

nor

didFailToRegisterForRemoteNotificationsWithError

get called. So I am not able to get the device token to push the notification to my device from PushMeBaby mac server for testing. I am having a jailbroken iphone 2g with iPhone OS 3.1.2

Can anyone help me with this...

Thanx in advance...

Upvotes: 1

Views: 837

Answers (2)

jayesh kavathiya
jayesh kavathiya

Reputation: 3541

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)dToken { 

    NSString *strToken = [NSString 
                     stringWithFormat:@"%@",dToken];

    NSLog(@"deviceToken is : %@",strToken);

    strToken = [strToken stringByReplacingOccurrencesOfString:@" " withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@"<" withString:@""];
    strToken = [strToken stringByReplacingOccurrencesOfString:@">" withString:@""];

    NSLog(@"deviceToken is : %@",strToken);
}

Upvotes: 1

Mike S.
Mike S.

Reputation: 111

The problem here is that you are using Jailbroken iPhone. According to my experience APNS does not serve 'hacked' devices and the first symptom is that they do not send a reply. You can borrow a device to verify this.

Upvotes: 4

Related Questions