chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
01/11/14 08:09 PM (11 years ago)

Pesky donation rejections by Apple

Just had a non-profit app rejected by Apple because of an in-app donation page. The problem was, I had this set as a tab pointing to a Custom URL screen. My solution? Make a really simple code change to the plugin. (Actually, I created a new version of the screen so I could use the non-edited version in other screens). I simply added the "viewDidAppear" method inside the plugin, as follows: ************************************** -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self.webView removeFromSuperview]; [self launchInNativeApp]; } ************************************** Now, when someone clicks on the tab, it shows a blank screen (or a screen with a specified background image) and immediately gives a popup asking to load the screen in Safari. If the user presses "yes", it will redirect them out of the app, in accordance with Apple's guidelines. If they click "no", it will dismiss the popup and just show them the background image.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/11/14 09:38 PM (11 years ago)
If you don't want to mess with the code you can use the 'launch native app' selection in the control panel, and direct it to launch safari to a URL. It doesn't require any code modification. Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/11/14 09:42 PM (11 years ago)
Smug has a good point. Chris just taught me an interesting coding technique. Thanks to both of you! :-) -- Niraj
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/11/14 09:46 PM (11 years ago)
@Smug - didn't want to do that, because I couldn't show the webpage first. The "launch native app" option just shows a button to do that, right?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/11/14 09:47 PM (11 years ago)
Not even that; it's a menu selection, and off you go. It's fairly sparse. But it doesn't require any editing. I can see advantages to your method; I'll probably do the same thing in the future… But for the average Joe who can't code, it's a bit daunting. Cheers! -- Smug
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/12/14 12:20 AM (11 years ago)
What I did: My plugin may be useful for non-coders. I created an instance of my JC_ActionSheet plugin, then set the message to "Do you want to open Safari?," had 2 buttons, and set one of them to a Launch Native App. Approved by Apple. Good User Experience because the user is prompted before leaving the app. Jake
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
01/12/14 04:32 AM (11 years ago)
Nice advise Chris!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/12/14 09:07 AM (11 years ago)
I like Jake's idea also. Great collaboration by all !!! :-) -- Niraj
 
Jordan
Aspiring developer
Profile
Posts: 45
Reg: Oct 15, 2010
Orlando
2,100
like
01/14/14 04:00 PM (11 years ago)
Thanks for the advice....
 

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.