0

Urban Flyship으로 푸시 알림을 개발하려고합니다. 앱을 성공적으로 실행하고 있지만 기기가 내 계정에 등록되어 있지 않습니다. 그리고 나는 이러한 오류를 logcate에서도 얻고있다.도심 비행선으로 푸시 알림을받는 방법?

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

로그 캣이 당신의 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" /> 
관련 문제