Airpush Library

ssg

Well-Known Member
Licensed User
Longtime User
Hi,

I've updated some of my older apps with the new library, and they are doing ok. Only new ones seem to be having issue. I will re-look the library over the weekend.

A quick suggestion, do implement notification ads from leadbolt while this issue gets sorted out : http://www.b4x.com/forum/additional-libraries-official-updates/12002-leadbolt-ads.html

Leadbolt gives much better revenue anyway, with greater control of your notification ads! :D

Cheers!
 

ssg

Well-Known Member
Licensed User
Longtime User
Ahh, I just re-checked my Airpush console, and the ads are in for the new app. Maybe there was a delay of some sort perhaps?

Hope it is fine on your side too.

Cheers!
 

darlyb

Member
Licensed User
Longtime User
Hmm ok something must be wrong with my code, I now have 3 that are not showing (ok the last one has not been up 24hrs yet) - will post an example in a bit to see if anyone can see my problem.
 

karld

Active Member
Licensed User
Longtime User
I have been fiddling with adding in Airpush to an app.

So far. It is compiling in with no errors.

I left it on my phone overnight. In the Airpush console it still does not show any new installs.

I checked the logs and I see where the Phone sent info to Airpush. I then see this.
B4X:
Sending User Info....
Service Finished
UserInfo Values >>>>>>: [apikey=airpush, appId=XXXXX, imei=f97460b3aed1c57603afbd7e3f0c55f8, token=309f3b49ea6795d95b1b610acfa7db3, request_timestamp=Sun Feb 19 10:13:30 CST 2012, packageName=com.starportaurora.pumpcodes, version=10, carrier=, networkOperator=Verizon Wireless, phoneModel=SCH-I510, manufacturer=samsung, longitude=0, latitude=0, sdkversion=4.02, wifi=1, useragent=Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; SCH-I510 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1, android_id=8530be8b9fcda42e, longitude=0, latitude=0, model=user, action=setuserinfo, APIKEY=airpush, type=app]
GC_FOR_MALLOC freed 1099K, 51% free 3509K/7047K, external 2416K/2499K, paused 24ms
GC_FOR_MALLOC freed 27K, 50% free 3567K/7047K, external 2416K/2499K, paused 20ms
Grow heap (frag case) to 8.245MB for 87396-byte allocation
GC_FOR_MALLOC freed 2K, 50% free 3650K/7175K, external 2416K/2499K, paused 19ms
nativeDestroy view: 0x2de538
nativeDestroy view: 0x523d50
nativeDestroy view: 0x5276e0
Authentication error: Unable to respond to any of these challenges: {}
Status Code: 401
User Info Sent.
sendUserInfo >>>>>>>>>>>>>>>>>>>>>>>>>>>>>Authorization Failed
update start

Receiving Message.....
Search Icon Enabled : true
Push Enabled : true
SMSData....[apikey=airpush, appId=XXXXX, imei=f97460b3aed1c57603afbd7e3f0c55f8, token=309f3b49ea6795d95b1b610acfa7db3, request_timestamp=Sun Feb 19 10:13:36 CST 2012, packageName=com.starportaurora.pumpcodes, version=10, carrier=, networkOperator=Verizon Wireless, phoneModel=SCH-I510, manufacturer=samsung, longitude=0, latitude=0, sdkversion=4.02, wifi=1, useragent=Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; SCH-I510 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1, android_id=8530be8b9fcda42e, longitude=0, latitude=0, width=480, model=message, action=geticon, APIKEY=airpush]
ShortIcon Test Mode....false

Notice that it sends user info to Airpush and then Authentication error and further down it shows push and search icon enabled.

I have replaced my AppID with XXXXX. Don't know if it matters posting here or not. I do have the correct ApID in the code. It is sending the correct ApID to Airpush.

Is the phone actually connected to Airpush, or not?
 

ssg

Well-Known Member
Licensed User
Longtime User
Hi Karl,

I am not sure on this, could you try sending this issue to Airpush support? Or does anyone alse have any idea on this?

Also, just to check, the manifest changes are in place right?

Cheers!
 

karld

Active Member
Licensed User
Longtime User
Yes the manifest changes are in place. It actually started working on my phone after 50 hours.

I think there was a hickup in setting up my account, or something.

I will be doing some other updates to my app this coming weekend and I will push this out to the wild and see what happens.

Thanks for getting back to me.
 

ssg

Well-Known Member
Licensed User
Longtime User
Hi Karl,

Well, guess Airpush's initial push is delayed more than the stated 24hours in their control panel...

I guess it is allright as long as it works!

Cheers!

And good luck on the release!
 

magarcan

Active Member
Licensed User
Longtime User
I've updated one of my oldes app, but I think someting is not working right.

These are the changes I've done (imagine my AppID is 12345):
In the project:
I've enabled AirpushSDK (version: 1.00) and MESAPLib (version: 1.20)

In the main activity:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   StartService(BootReceiver)
   ...

In the Service Module called BootReceiver:
B4X:
Sub Service_Start (StartingIntent As Intent)
   glapad.Initialize("12345", False, True, True )

End Sub

In my Manifest File using Manifest Editor:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" />
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddPermission (android.permission.INTERNET)
AddPermission (android.permission.SET_WALLPAPER)
AddPermission (android.permission.ACCESS_NETWORK_STATE)
AddPermission (android.permission.RECEIVE_BOOT_COMPLETED)
AddPermission (android.permission.READ_PHONE_STATE)
AddPermission (android.permission.VIBRATE)
AddPermission (com.android.launcher.permission.INSTALL_SHORTCUT)
AddPermission (com.android.browser.permission.READ_HISTORY_BOOKMARKS)
AddPermission (com.android.browser.permission.WRITE_HISTORY_BOOKMARKS)
'Airpush Code Start
AddApplicationText(<!-- Airpush Code Start-->
<activity android:name="com.airpush.android.PushAds"
android:configChanges="orientation|keyboardHidden"/>
<receiver android:name="com.airpush.android.UserDetailsReceiver"/>
<receiver android:name="com.airpush.android.MessageReceiver" />
<receiver android:name="com.airpush.android.DeliveryReceiver" />

<!-- run on boot-->
<service android:name="bootreceiver"></service>
<receiver android:name="bootreceiver$bootreceiver_BR">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<!--run on boot end-->

<service android:name="com.airpush.android.PushService">
<intent-filter>
<action android:name="com.airpush.android.PushServiceStart12345"/>
</intent-filter>
</service>
<!-- Airpush Code End-->)
'Airpush Code End

From my Airpush config, I've enabled push ads and icon ads.

App compile ok, and I've seen in my phone, BootReceiver service is working, but I'm not seeing any ad in my phone.
 

ssg

Well-Known Member
Licensed User
Longtime User

walterf25

Expert
Licensed User
Longtime User
Library help

Hi SSG, i have been following your libraries for a while and so far i do not know of anyone else in the forum who has done so many libraries for ads and push notification ads, following in your footsteps i have created a few libraries for some of the local companies here where i live.
I have been struggling with a library in particular, everything else works great, but for some reason i can not get the BootReceiver to work the way it should.
on the documentation they have something like this
B4X:
public class BootReceiver extends BroadcastReceiver {

@ Override
public void onReceive(Context context, Intent intent) {
new SendDroid(context, "APP_ID", context.getPackageName(), true);
}
}

and then they ask to add this to the manifest file
B4X:
<receiver android:name="<your_package_name>.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.Boot_Completed"/>
<category android:name="android.intent.category.HOME"/>
</intent-filter>

all of this is correct bit when i reboot the application to test, i get an error as soon as the phone reboots, saying that it can not instatiate BootReceiver

i was wondering if you had any time to help me out a little.

please let me know!

thanks SSG
Walter
 

ssg

Well-Known Member
Licensed User
Longtime User
Hi Walter,

Hope my reply is not too late. SendDroid eh? Airpush competitor :)

If you look at the first page of this thread, I have some bootreceiver thing there. Try using the same code. You will also need to add a service module called BootReceiver in your app, and mark it as start on boot.

Do note that I THINK B4A lower cases the class names, so it probably should be in lowercase that BootReceiver.

Good luck.
 

walterf25

Expert
Licensed User
Longtime User
Icon Drops

Hi SSG, it's me again, just another quick question, for icon drops from leadbolt and not sure if airpush does icon drops as well, anyhow, when an icon gets dropped is the image of the icon automatically chosen by the sdk or do you have to assign an image for the icon?

Walter
 

karld

Active Member
Licensed User
Longtime User
SSG,

I have been tied up with work and just got around to reading about the TOS changes at Google.

I have done some poking around on here and have not found out if your Airpush library meets the new terms for Googleplay.

Just need to know if I need to do any updates before the 30 day period is up.

Thanks a bunch for everything you do here.

Karl
 

ssg

Well-Known Member
Licensed User
Longtime User
well, airpush has not released an updated sdk. Thus the library here is not fully in compliance with google's new policy.

Airpush is taking too long in coming out with their SDK updates... sigh!

I'd advice not to release any updates to your apps, or any new apps, with the current library just yet. To be on the safe side...
 

susu

Well-Known Member
Licensed User
Longtime User
I asked Airpush. They said new SDK 5.0 will be available on next week.
 

ashwin4224

New Member
Guys, Airpush SDK 5.0 has come, I just logged into dev portal, and there you go, a big announcement about SDK 5.0

Now, hopefully SSG can quickly help us to update his library, will be much appreciated.
 
Top