使用Eclipse集成城市飞艇

时间:2016-02-18 02:05:52

标签: android eclipse push-notification urbanairship.com integrate

我有一个应用程序想要整合Urban Airship来推送通知。 我没有使用Android Studio,但我找不到任何有关将Urban Airship与Eclipse集成的教程。 有人可以帮帮我吗? 谢谢你。

1 个答案:

答案 0 :(得分:0)

由于ADT no longer being supported or developed by Google.

,Urban Airship放弃了对日食的支持

eclipse风格项目的最后一个版本是6.4.3。您可以从bintray下载该版本。下载后,您需要将urbanairship-lib目录与最新的v4支持库和Google Play Services 8 +一起添加到您的项目中。

然后将以下内容添加到AndoridManifest.xml中(用您的包名替换$ {applicationId}):

权限:                                    

    <permission android:name="${applicationId}.permission.UA_DATA" android:protectionLevel="signature" />
    <uses-permission android:name="${applicationId}.permission.UA_DATA" />

    <!-- GCM -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />

    <!-- ADM -->
    <uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
    <permission android:name="${applicationId}.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="${applicationId}.permission.RECEIVE_ADM_MESSAGE" />

组件(在应用程序标签下添加):

<!-- ADM -->
<amazon:enable-feature
    android:name="com.amazon.device.messaging"
    android:required="false" />

<activity android:name="com.urbanairship.actions.ActionActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity android:name="com.urbanairship.CoreActivity" />
<activity android:name="com.urbanairship.google.PlayServicesErrorActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />


<activity
    android:name="com.urbanairship.actions.LandingPageActivity"
    android:exported="false"
    android:theme="@style/LandingPageStyle">

    <meta-data
        android:name="com.urbanairship.action.LANDING_PAGE_VIEW"
        android:resource="@layout/ua_activity_landing_page"/>

    <meta-data
        android:name="com.urbanairship.push.iam.EXCLUDE_FROM_AUTO_SHOW"
        android:value="true" />

    <intent-filter>
        <action android:name="com.urbanairship.actions.SHOW_LANDING_PAGE_INTENT_ACTION"/>

        <data android:scheme="http"/>
        <data android:scheme="https"/>
        <data android:scheme="message"/>

        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>

</activity>

<service android:name="com.urbanairship.push.PushService" android:label="Push Notification Service" />
<service android:name="com.urbanairship.analytics.EventService" android:label="Event Service" />
<service android:name="com.urbanairship.actions.ActionService" />
<service android:name="com.urbanairship.richpush.RichPushUpdateService" />
<service android:name="com.urbanairship.location.LocationService" android:label="Segments Service" />

<service
    android:name="com.urbanairship.push.UAInstanceIDListenerService"
    android:exported="false">
    <intent-filter>
        <action android:name="com.google.android.gms.iid.InstanceID"/>
    </intent-filter>
</service>

<receiver android:name="com.urbanairship.CoreReceiver"
          android:exported="false">

    <intent-filter android:priority="-999">
        <action android:name="com.urbanairship.push.OPENED" />
        <category android:name="${applicationId}" />
    </intent-filter>
</receiver>

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

    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
        <category android:name="${applicationId}" />
    </intent-filter>
</receiver>

<receiver
    android:name="com.urbanairship.push.AdmPushReceiver"
    android:permission="com.amazon.device.messaging.permission.SEND">

    <intent-filter>
        <action android:name="com.amazon.device.messaging.intent.REGISTRATION" />
        <action android:name="com.amazon.device.messaging.intent.RECEIVE" />
        <category android:name="${applicationId}" />
    </intent-filter>
</receiver>

<provider
    android:name="com.urbanairship.UrbanAirshipProvider"
    android:authorities="${applicationId}.urbanairship.provider"
    android:permission="${applicationId}.permission.UA_DATA"
    android:exported="true"
    android:multiprocess="true" />