mob platform realizes push function
- The first step: Mob platform account
- Step 2: Configure the MobPush environment on the mob platform
-
- 1. Click the product center in the blue circle in the figure below.
- 2. Click to enter now.
- 3. Click Create Application.
- 4. Agree to the privacy service.
- 5. Create an application
- 6. Click the red circle in the figure below to access the interface.
- 7. Select `MobPush`
- 8. Get your `App Key` and `App Secret`.
- 9. Click SDK to download.
- 10. Download MobPush
- Step 3: Add MobPush code to the android project
- Step 4: Push configuration
- Step 5: Implement the push function
建议仔细观看每一个步骤,如果一个步骤没处理好,可能就会让你的这个功能无法实现。相信我一定可以成功的。
The first step: Mob platform account
Because I have already registered for the mob platform and there is no extra mobile phone number, I won't elaborate on it. Registration is relatively simple. The link to the mob platform is attached below:
mob platform link : https://www.mob.com/
Step 2: Configure the MobPush environment on the mob platform
For specific details, please refer to my article:
Detailed explanation of 2020 nanny-style pictures for android mobile number login, teach you step by step to implement Mob+SMSSDK platform?
If I have time, I will provide the realization of QQ sharing and other functions. The push function is fairly simple compared to other functions.
1. Click the product center in the blue circle in the figure below.
2. Click to enter now.
3. Click Create Application.
4. Agree to the privacy service.
5. Create an application
Remember that 128px*128px
if you don’t know how to set the picture size, you can search the FastStone editor on the Internet. I don’t know where to put his installation package. You can find it online, but the drawing software that comes with the window seems You can also set the size (I am not very sure). Don't talk nonsense, get to the point.
6. Click the red circle in the figure below to access the interface.
7. ChooseMobPush
8. Get your App Key
sum App Secret
.
注意你的App Key和App Secret等下要使用
It is recommended to use your own, because the process is not difficult.
9. Click SDK to download.
10. Download MobPush
保存配置之后,然后点击下载
Then it will give a download prompt, because my mobile phone is a Huawei mobile phone, I initially thought that I wanted to get his appid, and I deliberately registered as a Huawei developer (but the process is more troublesome), and then I found out that 不需要appid
it can also be used, there are detailed steps later .
Step 3: Add MobPush code to the android project
1. Create a new Project or Module ( 记住你的包名,下面会用到(重点)
).
2. Add the following code to your build.gradle (Project)
记住这里是build.gradle(Project)(Project负责管理这个项目里面所有的Module)而不是build.gradle(Module)。
Add the code as follows: the
code is as follows:
classpath "com.mob.sdk:MobSDK:2018.0319.1724"
maven {
url 'https://jitpack.io' }
3. Add the following code to your build.gradle (Module)
记得修改为你自己的apppKey和appSecret
If your code is android studio4, as shown below: The
code is as follows:
id 'com.mob.sdk'
MobSDK {
appKey "31fb0826f078e"
appSecret "45d6afd2cbb8416e7378ca33212c3dfc"
MobPush {
}
}
If you are other versions, the code is as follows:
apply plugin:'com.mob.sdk'
MobSDK {
appKey "31fb0826f078e"
appSecret "45d6afd2cbb8416e7378ca33212c3dfc"
MobPush {
}
}
Step 4: Push configuration
1. Click Push Settings
2. New package name: remember to be with you新建Project或者Modue的包名一样
3. Set your new package name as the default package
The effect is as follows:
4. Run your project
因为我的手机模拟器出现了点问题,这里我用本机测试,手机模拟器具体能不能实现,你们可以自己去探究一下。
We can see that the operation was successful, as shown below:
Step 5: Implement the push function
1. Click Create Push
2. Fill in the push information
Others remain unchanged, and then click Send now:
3. Push successfully
Congratulations, the desired effect has been completed. If you encounter any problems, you can raise them, because after all, I can't consider this situation alone.
功能虽然简单,但是步骤并不少,只要细心肯定是可以实现的。