0

Я пытаюсь разработать push-уведомление с Urban Airship. Я успешно запускаю приложение, но мое устройство не регистрируется в моей учетной записи. Я также получаю эти ошибки и в logcate.Как получить push-уведомление с городским дирижаблем?

01-24 19:20:47.480: W/GCMNotification - UALib(30560): Activity [email protected] was not manually added during onStart(). Call UAirship.shared().getAnalytics().activityStarted in every activity's onStart() method. 

01-24 19:21:14.400: E/GCMNotification - UALib(31088): AndroidManifest.xml missing required service: com.urbanairship.analytics.EventService 

01-24 19:21:14.410: E/GCMNotification - UALib(31088): AndroidManifest.xml's com.urbanairship.push.GCMPushReceiver declaration missing required com.google.android.c2dm.intent.RECEIVE filter with category=com.example.gcmnotification 

01-24 19:21:14.410: E/GCMNotification - UALib(31088): AndroidManifest.xml's com.urbanairship.push.GCMPushReceiver declaration missing required com.google.android.c2dm.intent.REGISTRATION filter with category=com.example.gcmnotification 

код есть здесь.

public class MyApplication extends Application{ 

@Override 
public void onCreate() { 


    AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this); 

    options.developmentAppKey = "pahvQlDxxx"; 
    options.developmentAppSecret = "bOltfxxx"; 
     options.productionAppKey = "AIzaSyCS_QxF-AtTglLf5BWxxx"; 
    options.inProduction = false; 
    //options.iapEnabled = false; 
    UAirship.takeOff(this, options); 
    PushManager.enablePush(); 

} 

}

ответ

2

LogCat говорит вам именно то, что отсутствует в вашем AndroidManifest.xml.

Ваш радиовещательный приемник должен быть объявлен следующим образом:

<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="com.example.gcmnotification" /> 
     </intent-filter> 
    </receiver> 

И вы должны объявить com.urbanairship.analytics.EventService:

<service android:name="com.urbanairship.analytics.EventService" /> 
Смежные вопросы