2013年9月24日星期二

[Share] phonegap push- message push to achieve

Recently been studying a variety of push , ios 's because it is apns, relatively easy to implement, but andriod 's more trouble . After reading a lot of solutions , gcm obviously does not work, other options even more confused, and need to do a second development, too much trouble , and later choose to use third-party services to achieve push .

currently do better to have a push and Aurora .

optimal but need to pay a push . For us such a small app, simply can not cope , and then decisively choose Aurora .

The following are my phonegap sdk integration process with the aurora .


  1. registered aurora developer account , and register application information.

Create an account
push into the Aurora platform , the first show is to create application interface. Fill in your application's name, and this two Android package name on it.


used successfully created , namely into the " Application Details " display. Lower right corner of this screen , you can see the "appkey" will be used later .



  2, download the sdk package . On the line integration


specific processes can see the following documents , of course phonegap integration and this is somewhat different.

http://docs.jpush.cn/pages/viewpage.action?pageId=557214


  3.SDK integration steps

1, import the SDK development package into your own application project

decompress jpush-sdk_v1.xyzip integrated compression package
Copy libs/jpush-sdk-release1.xyjar to the project libs / directory
Copy libs/armeabi/libsys1.xyso to the project libs / armeabi directory ( if your project has libs/armeabi-v7a this directory , please libsys1.xyso also copy into this directory )

demand note here is this: After the package must take the package to import into configuer building path.
2, configure AndroidManifest.xml

According compressed bag AndroidManifest.xml SDK sample files to configure the application project AndroidManifest.xml.

main steps :

Copy a note to "Required" part
will note the replacement of part of the package name , replacing the current application package name
will replace AppKey registered on the Portal of the application of the Key, for example (9fed5bcb7b9b87413678c407)






package = "Your Package"

android: versionCode = "100"

android: versionName = "1.0.0"

>












































android: icon = "@ drawable / ic_launcher"

android: label = "@ string / app_name"

android: name = "Your Application">




android: name = "cn.jpush.android.service.PushService"

android: enabled = "true"

android: exported = "false">


















android: name = "cn.jpush.android.service.PushReceiver"

android: enabled = "true">
























android: name = "cn.jpush.android.ui.PushActivity"

android: theme = "@ android: style / Theme.Translucent.NoTitleBar"

android: configChanges = "orientation | keyboardHidden">
















android: name = "cn.jpush.android.service.DownloadService"

android: enabled = "true"

android: exported = "false">































It should be noted that: before adding on some of the xml message , this time to eleven were put inside information a one added to it.

Note the order :




3, add the code

JPush SDK provides API interfaces are mainly concentrated in the cn.jpush.android.api.JPushInterface class.

accordance with the following methods to modify :



4, tests confirm

confirm the required permissions have been added . If you have not added the permissions , log an error .
confirm AppKey ( generated on the Portal ) has been correctly written Androidmanifest.xml.
confirmed when the program starts call init (context) Interface
confirmation test phone ( or emulator ) has been successfully connected to the network
Shortly after the client calls the init , and if all goes well , there should be a successful login log information
start the application , the application on the Portal sends a custom message or notification bar tips. Please refer to the Management Portal.
in a few seconds , the client should be able to receive a notice issued or are defined message

If the SDK is working properly , the log information is as follows:

As shown, the client initiates divided into four steps :

Check the metadata of appKey and channel, if you do not exist, then failed to start
initialization JPush SDK, check the validity of JNI library files , etc. , if the library file is invalid , then failed to start
check Androidmanifest.xml, if Required permissions does not exist, failed to start
connect to the server log , if there is a network problem, then login fails, or steps in front of a problem, do not start JPush SDK


As long as the test is successful , ok, you can go to manage Portal, to send the information. No accident , then, be able to receive information .

Of course, this is just a simple push messaging features , some of the specific application , you can then refer to the official api documentation to their own development.

Author : Yelan drizzle

------ Solution ------------------------------------ --------
advertising ah, China mobile has AOI
------ Solution ---------------------- ----------------------
access points.
I also used my aurora push very good with php asp pages that push code
If you need to add I sent you q 10047588
------ Solution ------------------- -------------------------
very detailed, learn about the
------ Solution ------ --------------------------------------
 I realize I get when it comes to mistakes, watched you for sharing did not know he was not careful enough ah
------ Solution ---------------------------------------- ----
that the landlord has not tried androidpn? aurora is not a good lot of it
------ Solution ----------------- ---------------------------
seemingly quite simple integration process , learning the
------ Solution --------------------------------------------
good thing , the aurora is free?
------ Solution ---------------------------------------- ----
documentation is very detailed , basically able to understand the development of their own to get, very good
------ For reference only -------------- -------------------------
 The original can be so simple , the landlord to force ah
------ For reference only ------------ ---------------------------
 powerful ah , learning to learn
------ For reference only -------------- -------------------------
simple ah, do not push enough stable , messages are timely arrival of it ?
------ For reference only -------------------------------------- -
just need the first collection it.
------ For reference only -------------------------------------- -
tried it, very timely
------ For reference only --------------------------- ------------
quite simple push implementation process , thank you for sharing
------ For reference only ------------- --------------------------
so simple , according to the next test to see how effective
------ For reference only ---------------------------------------
very detailed , try
------ For reference only --------------------------------------- < br> Thank you for sharing
------ For reference only --------------------------------- ------
looks good, go try
------ For reference only ---------------------- -----------------
really detailed, hard work , thank you sharing
------ For reference only ---------- -----------------------------
landlord really clever
------ For reference only ---------------------------------------
very detailed , thank you for sharing < br> ------ For reference only ---------------------------------------
Thank you, looking for the integration of these data
------ For reference only --------------------------- ------------
very detailed wow
------ For reference only ---------------------------------------
thank the landlord and the aurora phonegap sdk integration
------ For reference only ----------------------------------- ----
I am also considering , just look
------ For reference only ----------------------- ----------------
Thank you to share
------ For reference only ---------------------------------------
landlord phonegap sdk with aurora the integration process is very detailed

没有评论:

发表评论