0

I have a really weird thing happening. i am registering device tokens in DB for push service. using

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
    NSLog(@"===============didRegisterForRemoteNotificationsWithDeviceToken=============");

    NSLog(@"My token is: %@", deviceToken);
    // Prepare the Device Token for Registration (remove spaces and < >)
    NSString *devToken = [[[[deviceToken description]
                            stringByReplacingOccurrencesOfString:@"<"withString:@""]
                           stringByReplacingOccurrencesOfString:@">" withString:@""]
                          stringByReplacingOccurrencesOfString: @" " withString: @""];

    NSLog(@"My token is: %@", devToken);
}

as my code. now when i run the app on Xcode i get a token like this:

78bb45dc391bf920f5f5b2ac188ffb2bebfb5e1163e89a4482c56c32f02e092f

and my app works well.

When i install the same app via web (testflight or Diawi) i get a token like this:

e61c305464731d8d5302db2289b01d18621fb5fad04683dd81ffad6961d60213

and the push is not being received on the device.

Any Idea what is going on here????

Kampai
  • 22,848
  • 21
  • 95
  • 95
Roi_W
  • 95
  • 1
  • 1
  • 8
  • I am using sparkinspector (i have no clue how to turn it off), if that might cause anything? – Roi_W Oct 16 '14 at 12:44
  • http://stackoverflow.com/questions/19524942/ios-7-device-token-is-different-for-same-device – TonyMkenu Oct 16 '14 at 13:15
  • Maybe you are using a distribution provisioning profile for testflight and a development provisioning profile for xcode? If so you, they connect different apple servers and you will have to adjust your server. – Mats Oct 16 '14 at 14:19
  • i tried now with all differant configuration to export from the xcode, but it is always the same. – Roi_W Oct 16 '14 at 17:32
  • Have you solved this problem? Because i am facing same problem here, device token changes when I install app through diawi link... – Hiren Mar 12 '15 at 08:21
  • I am facing same issue but now It worked for me when I made ipa from xcode 5 not from 6 – Bhavesh Lathigara Sep 11 '15 at 10:33

3 Answers3

1

I was also facing same issue while installing app through diawi wireless installation.

As my solution(in my case) the problem was with the Xcode 6.1.

If you have Xcode 5 on your machine than make the archive of your project in Xcode 6 and than from the organiser of the Xcode 5 create the build.

This solution worked for me and I am now getting the push notification.

Answer referenced from: xcode 6 beta 2 issue with exporting ipa "Your account already has a valid iOS distribution certificate"

Community
  • 1
  • 1
Hiren
  • 676
  • 7
  • 21
1

When you are installing app directly from xocde then It may be developer provision profile. And when you install app from Testflight or Diawi, It's app with distribution profile.

Device token are different for developer and distribution profile. If your app with developer profile is working fine then it means your server has development APNS configuration at the moment.

You also need to update server code to distribution configuration to receive push notification. In configuration, mainly you need to upldate APNS certificate and APNS URL in code of server.

I hope it may solve your problem

Rahul Patel
  • 5,858
  • 6
  • 46
  • 72
0

I am facing same issue when generate ipa from xcode 6 and above and generate a diawi link, but now It worked for me when I made ipa from xcode 5 not from 6.

I don't know why this happened.

One more issue I faced that asked here: Device Tocken will Change after install from diawi or TestFlight? So Push notification is not coming

Community
  • 1
  • 1
Bhavesh Lathigara
  • 1,355
  • 1
  • 15
  • 25