Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-07-2011, 05:37 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 9
skot is on a distinguished road
Default aps-environment, AdHoc vs Debug

So the push notification service has two separate environments, Development and Production.

When your app registers for push notifications, it delivers up a device token which is either for Development or Production, depending on the app's "aps-environment" setting. The device tokens for Development and Production are different.

[Pardon the review, I'm saying this out loud so someone can correct me if I've got it wrong.]

Now my app is still in development, but I use an ad hoc distribution to share the app with my team for testing. The ad hoc distribution is considered a "release" build and generates Production device tokens.

But if I'm working in XCode and run the app on my phone (so I can see the logging/debugging output in XCode), the app generates Development device tokens.

Obviously this creates difficulties for my server app, since it's receiving Development device tokens from some clients and Production tokens from others.

Is there a way I can get my Debug configuration to generate Production device tokens? Maybe by setting "aps-environment" to "Production" somewhere?

Or: can I read the "aps-environment" setting at runtime, so I can pass this information to the server along with the device token?
skot is offline   Reply With Quote
Old 09-07-2011, 05:46 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Theoretically, you can distribute Debug builds as ad hoc. I haven't tried it, but I've seen here people that actually uploaded Debug builds to the App Store without getting any automated errors, so it should work just fine for Ad Hoc.
baja_yu is offline   Reply With Quote
Old 09-07-2011, 06:21 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by baja_yu View Post
Theoretically, you can distribute Debug builds as ad hoc. I haven't tried it, but I've seen here people that actually uploaded Debug builds to the App Store without getting any automated errors, so it should work just fine for Ad Hoc.
Gack. Really? Debug builds in the app store?

That's bad for a number of reasons.

First is security. Debug builds have built-in symbols. That's like a roadmap for hackers. It makes reverse-engineering your code much, much easier.

Second, debug builds are not optimized. They tend to run quite a bit slower than release builds. It depends on the type of code. Code that does a lot of number-crunching tends to be CPU-bound, so it benefits a lot from the optimizations that are the default for a release build.

Our company has a fractal renderer for Mac OS, and the release build is very fast, while the debug build can be painfully slow. That's an extreme case of a compute-bound application, and the release version is tens of times faster. (It's also an extreme case of code that really benefits from code optimizations.)

All that being said, I regularly send out debug builds to our trusted remote testers. They're simpler to set up than ad hoc builds, and best of all, crash logs include symbol information so they're much easier to figure out.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 09-07-2011, 06:27 PM   #4 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Yeah. I think someone recently asked here about it. They uploaded a Debug build by mistake and it got into review before they realized and asked what to do about it.
baja_yu is offline   Reply With Quote
Old 09-07-2011, 06:57 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 9
skot is on a distinguished road
Default

Duncan,
Can you tell me how you set up & send out the Debug builds? Or point me to something I can read to find out?
skot is offline   Reply With Quote
Old 09-07-2011, 06:59 PM   #6 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by skot View Post
Can you tell me how you set up & send out the Debug builds? Or point me to something I can read to find out?

Just have your users send their device's UDIDs, add them to your development provisioning profile, and send out both the app and the provisioning profile. The user drags both into the library section of iTunes and syncs. That's all there is to it.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Reply

Bookmarks

Tags
push notifications

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 373
8 members and 365 guests
apatsufas, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,671
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JackReidy
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:54 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0