Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
05/29/14 07:55 AM (9 years ago)

Push Notifications registering device in Design Mode. BT_Config is set to Live

I am having a problems with an app that just went live on the App Store. It is registering devices for push in design mode. I have confirmed that the BT_Config.txt in Xcode CurrentMode says Live. Here is what I have done to trouble shoot the problem so far. * I recompiled the app on my iPhone connected to Xcode and checked the the console logs and it is appending Design to the end of the registerForPushNotification URL. The BT_Config.txt in Xcode shows Live as the currentMode, BUT I manually updated this from my control panel and did not download the project again before submitting to Apple. Could that be the cause of the problem? * I also want to note that I have confirmed that the BT_Config.txt in my apps .ipa file submitted to Apple also shows currentMode as Live.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
05/30/14 07:59 AM (9 years ago)
I think I might have resolved my problem. Since there is not an easy way to test a production push notification certificate I won't know for sure until my app update is published to the App Store. Here is what I did to get my device to register for push notification in Live mode. In my Apps APPNAME_appDelegate.m file I changed lines 831 and 871 (Both lines are the Same Code) This is the ORIGINAL CODE useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&currentMode=%@", [self currentMode]]]; I changed the ORIGINAL CODE to this: useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&currentMode=%@", @"Live"]]; What this is doing is manually setting the devices currentMode to Live and not looking into the BT_Config.txt file. DO NOT DO THIS UNTIL YOU ARE READY TO SUBMIT TO APPLE or you will not be able to test push notification in Design mode. I will post again once the app is updated to let you know for sure if this resolved the problem.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/30/14 10:11 AM (9 years ago)
Good sleuthing!
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
06/06/14 11:06 AM (9 years ago)
My app update is live and I have confirmed that the fix posted above (2nd post) DOES RESOLVE the problem. The only other thing I did was delete all of the iOS devices from the push notification BT console and let them all register again with the updated app.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/06/14 07:10 PM (9 years ago)
Can you check if your config file within the project is in "Live" mode or not? (even though you have checked a million times, I feel compelled to ask :-) Perhaps BuzzTouch Control Panel is not sending the "Live" version of the configuration to the mobile app? Also, I would look at value of [self currentMode]. The CP version of the config is cached on the device and the file version of the config within the project gets ignored thereafter. Anyhow, I was just tossing around ideas. You've got it working to satisfaction! :-) -- Niraj
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
06/08/14 07:14 AM (9 years ago)
Niraj - Yes I did confirm that the config file in the project is set to Live. I even checked the config file in the .ipa file downloaded from the app store and it was also set to Live. For some reason without modifying the APPNAME_appDelegate.m file with the changes mentioned above devices would not register in Live mode for push notifications. The one thing I did not do and have not tested is if I would have downloaded my project from the control panel after configuring push notifications and submitted that to Apple. I did not want to do this because I had already made a few changes to the "core" code files and did not want to have to redo all of my changes. I did update the BT_Config.txt file in the project before submitting the app to Apple. The fix I came up with is not a problem as long as you understand that making those changes before you are ready to submit to Apple will make your development devices register for push in Live mode and sending test push to Design mode devices will not work and sending to Live mode devices that registered from the development install of the app will also not work. Sending push notification to a device in Live mode require the app to have been installed with a signed distribution profiles. (Basically it had to get installed from the App Store).
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.