Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 443

piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
07/08/13 04:30 PM (12 years ago)

Disabling push notifications via xCode and Eclipse?

Hello, I'm currently building an app that I'd like to have push notifications for in a paid version. I'd like to also offer the exact same app for free, only without push notifications, however I really don't want to have to remake the entire app, and im sure there has to be a way to do this but I'm not quite sure where to look. How would I go about disabling push notifications via the code in xCode and Eclipse, so that I can publish the free app and it won't prompt users for push notifications as well as won't display push notifications that are sent via the paid app? Thanks!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/08/13 06:19 PM (12 years ago)
Hmmm. thats a good idea. one thing you could try is pushing to a specific page. Kittsy came up with a solution for iOS: http://www.buzztouch.com/forum/thread.php?tid=E067E6B3F2A28761C339861 Try using inApp to protect those pages and that could give those without the upgrade an incentive to receive the notification. They know its there but can't access it because of the necessary upgrade. Android .. no idea :/
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/08/13 07:41 PM (12 years ago)
Like the idea - for iOS you could use the Easy In-App Purchase (EIAP) plugin. You'll have to do some modifications to it and the appDelegate. Basically, you'll want to save a preference string to the device if the EIAP has been paid (there's a spot when the purchase is made, and another when the purchase is restored). Then, in your appDelegate, you'll want to surround the push notification code with an if/then check to see if the preference string exists/matches the value you assigned. For Android, the process would be similar - only problem is, there's no EIAP plugin for Android yet.
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
07/09/13 06:11 AM (12 years ago)
Is there just a line of code somewhere I can comment out to disable the push notifications? Or is it more complex than that?
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
07/09/13 06:08 PM (12 years ago)
Figured it out, easy solution. In the Eclipse project, just find promptForPush = true; in BT_activity_base.java and change the value to False. Then prompts won't appear :) From there, you'd just download the same project code, import it, right click the project, goto Android Tools > Rename Application Package and change it to something different so the market allows you to upload both, and viola!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/09/13 06:29 PM (12 years ago)
cool! thanks for sharing :)
 

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.