Android 个推 Clientid,PushManagerReceiver

今天做了个关于推送的项目,用到了个推,但是在做的过程中需要用到Clientid,但是无论如何获取的cid都是空的,研究了好久才发现原来是自己的配置出错了,为了避免大家犯同样的错误,我就把本人犯过得关于个推的给大家总结一下;

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.igexin.sdk.PushManagerReceiver" on path: /data/app/com.yijia.aviationemergency-2.apk

出现上面的错误时我也很郁闷到底是怎么回事啊?问客户人家说是我的sdk版本问题,让我更新sdk,我也很郁闷,可是他们的平台推送没有问题啊?研究好久才发现原来是引入的jar包问题,我现在的jar包是这里写图片描述
通过更换jar才发现原来是jar的问题
关于cid为什么获取的为空这个问题更是纯属意外,如果你按找官方的要求配置是不应该出错的,但是由于本人一时粗心把注释去掉后,少替换了一处appid,当我把appid替换成自己的以后问题就解决了

  
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="getui.permission.GetuiService" />
    <uses-permission android:name="android.permission.GET_TASKS"/>

    
    <permission
        android:name="getui.permission.GetuiService"
        android:protectionLevel="normal" >
    permission>

    

    <application
        android:icon="@drawable/demo"
        android:label="@string/app_name"
        android:persistent="true" >

        
        <activity
            android:name="com.lyx.demo.GetuiSdkDemoActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        
        
        <meta-data
            android:name="PUSH_APPID"
            android:value="SkZqEtvk9a7YHdzLuaWgR" />
        <meta-data
            android:name="PUSH_APPKEY"
            android:value="sXgDqcuOtT8V7CQm6WHV61" />
        <meta-data
            android:name="PUSH_APPSECRET"
            android:value="jdjMAnCq8WACMvuFXV1c55" />
        <meta-data
            android:name="PUSH_GROUPID"
            android:value="" />

        
        <receiver
            android:name="com.lyx.demo.PushDemoReceiver"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.igexin.sdk.action.etVyv7RHJ28BqN3KKCtKJ6" />
            intent-filter>
        receiver>

        
        <service
            android:name="com.igexin.sdk.PushService"
            android:process=":pushservice"
            android:exported="true"
            android:label="NotificationCenter" >
        service>

        <receiver android:name="com.igexin.sdk.PushReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
                <action android:name="android.intent.action.USER_PRESENT" />
                <action android:name="com.igexin.sdk.action.refreshls" />
            intent-filter>
        receiver>
        <receiver
            android:name="com.igexin.sdk.PushReceiver"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.igexin.sdk.action.pushmanager" />
            intent-filter>
        receiver>

        <activity
            android:name="com.igexin.sdk.PushActivity"
            android:process=":pushservice"
            android:excludeFromRecents="true"
            android:exported="false"
            android:taskAffinity="com.igexin.sdk.PushActivityTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        activity>

        <service android:name="com.igexin.download.DownloadService" android:process=":pushservice" />
        <receiver android:name="com.igexin.download.DownloadReceiver"> 
            <intent-filter>
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            intent-filter>
        receiver>
        <provider
            android:process=":pushservice" 
            android:name="com.igexin.download.DownloadProvider"
            android:authorities="downloads.com.getui.demo"  />
            

        <activity android:name="com.igexin.getuiext.activity.GetuiExtActivity"  
            android:configChanges="orientation|keyboard|keyboardHidden"
            android:excludeFromRecents="true"
            android:process=":pushservice"
            android:taskAffinity="android.task.myServicetask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:exported="false" />

        <receiver android:name="com.igexin.getuiext.service.PayloadReceiver" android:exported="false" >
            <intent-filter>
                 
                <action android:name="com.igexin.sdk.action.7fjUl2Z3LH6xYy7NQK4ni4" />
                             
                <action android:name="com.igexin.sdk.action.etVyv7RHJ28BqN3KKCtKJ6" />
            intent-filter>
        receiver>

        <service android:name="com.igexin.getuiext.service.GetuiExtService" android:process=":pushservice" />

        
    application>

一定要按照上面的配置才不会出现错误哦!Android交流群 470707794

你可能感兴趣的:(android)