开发者

how to implement urban airship in android

how to implement urban airship in android? i download开发者_如何学编程 the sample from here. i run the app i get install option. after the installation i get nothing. actually i do not know how to set up urban air ship with android. i just register an app name xxxx. i am do not created my xxxx app. but i confused with urban air ship implementation. my need is in my xxxx app i touch the button i have to list out videos what i have posted in urban air ship. please help me.

in the above site i get two files MainActivity and sampleApplication. i do not know where i am use the code in my xxxx app. please help me.


In your AndroidManifest-

<receiver android:name="com.urbanairship.CoreReceiver">
            <intent-filter>
              <action android:name="android.intent.action.BOOT_COMPLETED" />
              <action android:name="android.intent.action.ACTION_SHUTDOWN" />
            </intent-filter>
        </receiver>

        <receiver android:name="com.urbanairship.push.c2dm.C2DMPushReceiver"
                android:permission="com.google.android.c2dm.permission.SEND">

          <intent-filter>
              <action android:name="com.google.android.c2dm.intent.RECEIVE" />
              <category android:name="com.your.app.here" />
          </intent-filter>

          <intent-filter>
              <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
              <category android:name="com.your.app.here" />
          </intent-filter>
        </receiver>

        <service android:name="com.urbanairship.push.PushService" />

Be sure to -

import com.urbanairship.AirshipConfigOptions;
import com.urbanairship.UAirship;
import com.urbanairship.push.PushManager;

In your activity or class file -

AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);
            options.developmentAppKey = "YOURAPPKEY";
            options.developmentAppSecret = "YOURAPPSECRET";
            options.productionAppKey = "";
            options.iapEnabled = false;
            options.inProduction = false; //determines which app key to use

            UAirship.takeOff(this.getApplication(), options);  
            PushManager.enablePush(); 

Hope This Helps :)


you can go through by This. It has detailed description how to implement urbanairship for android.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜