AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
04/06/16 08:08 AM (8 years ago)

Pushwizard and BuzzTouch Android Problem

I used to use parse.com for push notifications, as I could never get the BT push working properly for a production app. I've been looking for an alternative service and I've stumbled across pushwizard.com. It looks pretty good and I've managed to make it work for iOS - I'm working on a how to guide that I plan to publish later. The problem is with Android; I'm having a devil of a job getting it to compile without errors in Eclipse (let alone see if it works). The stumbling point following their guide for Android Studio, is when I attempt the final step of their guide <a href="http://support.pushwizard.com/hc/en-us/articles/206337818-Integrating-the-Android-SDK" target="_blank" rel="nofollow">http://support.pushwizard.com/hc/en-us/articles/206337818-Integrating-the-Android-SDK</a> I'm trying to add their code to my appname_appDelegate.java (pushwizard step 6) but I get errors in Eclipse that stop my project compiling and nothing I do makes them go away. If anyone has any suggestions, please shout. The code block I'm trying to add is private static final String PUSHWIZARD_APPKEY = "YOUR PW APPKEY"; private static final String GOOGLE_PROJECT_NUMBER = "GOOGLE PROJECT NUMBER"; @Override protected void onResume() { super.onResume(); PushWizard.launchPushWizard(this, GOOGLE_PROJECT_NUMBER, PUSHWIZARD_APPKEY , null, "start", PushWizard.GEOLOCATION_PROCESSING_MODE.OFF //comment out on SDK 1.0.3 ); //the null param can be a String array for Tags } @Override protected void onPause() { super.onPause(); PushWizard.handleSession(null, "end", PushWizard.GEOLOCATION_PROCESSING_MODE.OFF //comment out on SDK 1.0.3 ); //the null param can be a String array for Tags }
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/06/16 06:39 PM (8 years ago)
Wouldnt know without seeing the errors. Can you post them? And its better to use android studio too. You can also use bt push for self hosted or new android studio buzztouch package. I posted a easy fix here: http://buzztouch.com/forum/thread.php?fid=B671F91BAC0C789AF2788AA&tid=B671F91BAC0C789AF2788AA
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/06/16 07:52 PM (8 years ago)
G'day @AlanMac, I've recently and successfully used PushWoosh and OneSignal on Android projects for push notifications. I've found that I have better luck when adding the "non-BT code" to the "BT_activity_host.java" file rather than the app delegate file. I don't know Android like @cmcoffee but there are @override methods in this main activity file around line 113. I've been putting the code there along with some other amendments to get it all to work. Let me know how you go! @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); BT_debugger.showIt(activityName + ":onCreate"); // Add code here ...
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/07/16 06:58 AM (8 years ago)
@ictguy, I thought I would try onesignal as you've had some success with that. It took me all day, but I managed to make it work, using your advice. I encountered a few gotchas along the way, but so far, so good. Only problem is alerts do not show if the app is in the foreground.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/07/16 07:01 AM (8 years ago)
@CMCOFFEE, you are right about switching to Android Studio, I use self hosted, which I know is good with Eclipse. I've been putting it off switching and I wanted to have the least number of things changing before I give that challenge a go. You asked about my pushwizard errors: I declared the private variables above onCreate where @ictguy suggested, then I added the rest of the code for pushwizard now goes, as follows: //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); BT_debugger.showIt(activityName + ":onCreate"); /* pushwizrd stuff from here */ @Override protected void onResume() { super.onResume(); PushWizard.launchPushWizard(this, GOOGLE_PROJECT_NUMBER, PUSHWIZARD_APPKEY , null, "start", PushWizard.GEOLOCATION_PROCESSING_MODE.OFF //comment out on SDK 1.0.3 ); //the null param can be a String array for Tags } @Override protected void onPause() { super.onPause(); PushWizard.handleSession(null, "end", PushWizard.GEOLOCATION_PROCESSING_MODE.OFF //comment out on SDK 1.0.3 ); //the null param can be a String array for Tags } /* pushwizrd stuff to here */ The error is : on token "void", @ expected
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/07/16 04:38 PM (8 years ago)
Great to hear you got it going! I was actually quite impressed withe one signal dashboard. IOS was really easy to implement - took less than an hour! Andriod was a lot harder as I had to comment out a lot of the BT methods. I think if I take out the references in the manifest first, it might be an easier task. All the best Darrel
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/07/16 04:42 PM (8 years ago)
I see you missing the closing curly brace for the onCreate method .I don't understand why your're getting that message though.
 

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.