Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 15    Views: 69

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
04/02/13 06:59 AM (12 years ago)

Push - Can't quite get there

So I used to think I could do push on IOS, but now I can't. I had cracked it with Parse,com, but my recipe for cooking up a parse.com push doesn't work any more, as the latest code with the BT push built seems to conflict. Scenario one - BT Hosted, Dev Push works, Production Push doesn't. I have built a test app on my BT hosted control panel and on my self hosted. I created an apple development profile and an adhoc profile enabled for push On the BT Hosted, the push works in BT Design mode with Apple Development code-signing. I then changed to BT Live Mode and code-signed my app with Development profile and then Adhoc profile but I cannot get the app to show as registered for push Live mode. Scenario 2 - Self Hosted Design mode - App registers but doesn't receive pushes. Not much more to say on this one. I have read all the posts with push. My host provider says all the ports are open and I have delted all my apple profiles in Xcode and refreshed. I recreated the CSR's and certs twice, but overall, it is proving rather complex to debug this problem. It is the lack of error messages that makes it really hard, but if anyone has any tips, or is experiencing the same as me, please let me know. Thanks, Alan
 
bfoutty
Code is Art
Profile
Posts: 185
Reg: Jun 12, 2011
Youngstown, OH
12,650
like
04/02/13 07:19 AM (12 years ago)
I have a similar issue, but I use Appoxee for push. You can still use a 3rd party for push. You just have to delete the included lines of code in the BT download. The lines that you need to delete are lines 130 - 276 and lines 509 - 512. After you delete these lines, you can then insert the code from your company of choice. I have done this with 3 of my apps and everything compiles and runs, no problems.
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
04/02/13 08:23 AM (12 years ago)
I have the same problem. Devices register correctly, but can only push to developing, not to live. Haven't found a way around it yet. Miguel
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/02/13 09:30 AM (12 years ago)
Good to know I am not alone here guys. Many thanks @bfoutty, I managed to get parse push working in my test app, with the development profile and an adhoc distribution profile. This is good news as it proves the distribution certificate on this app is not the problem; 99% of the time, certificates is where it usually goes wrong. In fact, after gaining the confidence that Parse worked, I managed to get parse and BT push working on the same app, (but with BT still only for Development). I did it like this. In Xcode, I got BT push working for Dev/Design mode. I then renamed references to methods with RemoteNotification in them to RemoteBTNotification, as that is where the conflict was. I tested to make sure the BT push still worked (it did) then added the Parse code that worked for me before and then both worked. Baby steps....
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/02/13 10:24 AM (12 years ago)
Miguel, is the problem for you the same on Self Hosted as BT hosted? I'm still keen to get the standard BT push working if possible.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
04/02/13 11:03 AM (12 years ago)
thanks @bfoutty I've looked at removing those methods as well because I use a couple of 3rd party services like Parse and Appoxee for PN. I don't need the BT PN services. Did you remove it because it was causing conflicts? I just started testing PN with Appoxee and Parse on Android and it seems to be a flaky. I'm wondering if the Google Cloud Messaging code that BT has added is causing problems.....? Both backend services are telling me the devices are registered and pushes have been sent - but getting the actual push on the device does not seem to occur. I wonder if we can get BT to let us know exactly what code they have added for PN and what we can remove for BOTH platforms. One of the big reasons to go SH is to use 3rd party services/SDK's like this. It's difficult to tell if SH folks are having issues with 3rd party PN services, so many PN related posts here covering so many issues.... I've been going thru the code and hacking stuff out manually. I compared files to an old project and that also helped.
 
bfoutty
Code is Art
Profile
Posts: 185
Reg: Jun 12, 2011
Youngstown, OH
12,650
like
04/02/13 11:13 AM (12 years ago)
Yes I removed them in Xcode. I got the multiple instances error in Xcode which were easy to find because Xcode points them out. For Android I am using the BT push notification process with great success. I found that the Appoxee classes were a pain. I am also much more comfortable with iOS and Xcode so I usually take the path of least resistance with Eclipse and Android. I am sorry that I cannot be of more help with Android.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/02/13 12:45 PM (12 years ago)
For IOS, You don't have to remove the IOS code, just renaming the multiple instances leaves you with a working option and having both in one app helps to debug. btw, I have parse and BT push working in Android app, both seem pretty reliable for me.
 
GJvanWijk
I hate code!
Profile
Posts: 95
Reg: Dec 19, 2011
location unknow...
6,000
like
04/03/13 02:57 AM (12 years ago)
I had the same problem. Devices showed up as registered but all in design mode. What did the tric for me was to edit the BT config file in the Live mode (it was still in design mode). Rebuild the whole crap and send it as an update to Apple, wait for a week to pass the review and then it worked. I also created a separate Provisoning Profile (distribution) with push enabled for production only. Don't know if that's important but you never know....
 
bfoutty
Code is Art
Profile
Posts: 185
Reg: Jun 12, 2011
Youngstown, OH
12,650
like
04/03/13 04:24 AM (12 years ago)
@AlanMac Good point about the renaming. Another option would be to simply comment out the BT code so that it is still in the package in case you would ever want to switch to BT and use their code and services.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/13 06:46 AM (12 years ago)
@bfoutty, I do agree it would be better to comment out the BT push code longer term - at this stage I still have hope of getting it to work and if you hadn't showed me where the code is, I probably would still have nothing working at all. @GJvanWijk, to get the app into 'BT live mode', my approach is to copy and paste the 'live' config.txt from the control panel into the local project. This technique works on Android, but on Apple, the device never registers as live. I have no idea why. The Production certificate is very important - the idea is that you create a AdHoc provisioning profile with the production certificate. If that works, then when you want to submit the app to Apple, you just change the AdHoc profile to full Distribution, knowing that you have successfully tested the certificate and push and that all and it worked (or not in my case). Appreciate the feedback. I'm still trying...
 
GJvanWijk
I hate code!
Profile
Posts: 95
Reg: Dec 19, 2011
location unknow...
6,000
like
04/03/13 08:48 AM (12 years ago)
Hi AlanMac, All I did was changing this one line in the BT_config.txt "currentMode":"Live", That's all.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/13 09:04 AM (12 years ago)
Hi @GJvanWijk, thanks, just tried that too. I think that my app is in live mode, but now that it is, it doesn't register for BT push. My feeing is that this issue affects more people than just me, but it does not affect everybody. Glad it worked for you though.
 
GJvanWijk
I hate code!
Profile
Posts: 95
Reg: Dec 19, 2011
location unknow...
6,000
like
04/03/13 11:18 AM (12 years ago)
but did you send it to the appstore again? cause that is what yoy have to do i'm afraid.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/13 12:17 PM (12 years ago)
I have not submitted to the app store, as I want to see it working properly with adHoc distribution before I do. Are you suggesting that I shouldn't expect to see it register in live mode before sending to Apple?
 
GJvanWijk
I hate code!
Profile
Posts: 95
Reg: Dec 19, 2011
location unknow...
6,000
like
04/03/13 08:43 PM (12 years ago)
Well i never worked with ad hoc distribution before so i don't know for sure. But to see it working in Live mode I'm pretty sure you'll to sent your binary compiled in Live mode as mentioned before. For me it was the solution to get work properly. By seeing users registrate in design mode it proves that the provisioning profile is working. So the only 2 things I did was: - create another distribution provisioning profile (only push enabled for production) based on an AppId I created for Live push (and that file exported as p12 and changed it to PEM for BT console) - changed the BT_config.txt as mentioned Archive, sent it to AppStore and pray ;-) Good Luck
 

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.