android平台的集成工作尚未完成,友盟社会化android组件集成的准备工作

1.注册友盟账号

登陆友盟官网,在我的产品页面添加新应用,然后获取到Appkey。

466eb9c4b5e9

2.1 微信

登录微信开放平台(点击链接),填写相关应用信息,审核通过后获取到微信AppID及AppSecret,如果需要微信登录功能,需要申请微信登录权限

准备工作微信开放平台账号、移动应用名称、移动应用简介(小于80字)、应用的图片(如图)

466eb9c4b5e9

应用的官网、应用包名、应用签名 (如图)

466eb9c4b5e9

开通微信登录、微信支付等功能

2.2 QQ及Qzone

登录腾讯开放平台(点击链接) ,选择移动应用,填写相关应用信息并提交审核,未审核前通过只能使用测试账号

2.2.1 注册腾讯开放平台账号(营业执照注册号、营业执照照片)

2.2.2 创建应用 (应用基本信息、安装包、图标素材等)

466eb9c4b5e9

2.3新浪微博

登录新浪微博开放平台(点击链接)

2.3.1准备相关应用基本信息、Android签名 包名信息、Android下载地址并上传icon图片

466eb9c4b5e9

2.3.2注意修改安全域名为sns.whalecloud.com同时设置授权回调页为http://sns.whalecloud.com/sina2/callback

安全域名设置在应用信息-->基本信息,具体位置参考下图

466eb9c4b5e9

3. 绑定第三方账号到友盟后台

把获取的第三方平台的APPId、APPKEY信息添加到友盟后台即可

目前需要在友盟后台绑定的第三方账号为:新浪微博、腾讯微博、Qzone,其余平台如微信、QQ直接在代码中设置

466eb9c4b5e9

4 .开发需要

该应用友盟的 APPKEY

该应用QQ及Qzone的 APPID、APP KEY

该应用微信的 APPID和APPSeret

该应用新浪微博的 AppKey、AppSecret

注 可参考友盟的社会化分享的文档中心的第三方账号申请及绑定

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
友盟推送集成Spring Boot可以通过友盟提供的Java SDK来实现。具体步骤如下: 1.在pom.xml文件中添加友盟推送的Java SDK依赖: ```xml <dependency> <groupId>com.umeng</groupId> <artifactId>umeng-message</artifactId> <version>1.3.2</version> </dependency> ``` 2.在application.properties文件中添加友盟推送的配置信息: ```properties # 友盟推送配置 umeng.appkey=your_appkey umeng.appMasterSecret=your_app_master_secret umeng.productionMode=false ``` 3.编写友盟推送的Java代码: ```java import com.alibaba.fastjson.JSONObject; import com.umeng.message.*; import com.umeng.message.common.inter.ITagManager; import com.umeng.message.entity.UMessage; import com.umeng.message.tag.TagManager; import java.util.List; public class UmengPushService implements UmengNotificationService { private final AndroidNotification androidNotification; private final IOSNotification iosNotification; private final PushClient client; public UmengPushService(String appKey, String appMasterSecret, boolean productionMode) { androidNotification = new AndroidNotification(); iosNotification = new IOSNotification(); client = new PushClient(); client.setAppKey(appKey); client.setAppMasterSecret(appMasterSecret); client.setProductionMode(productionMode); } @Override public void sendUnicast(String deviceToken, String title, String text, JSONObject extra) throws Exception { UMessage message = new UMessage(); message.setDeviceToken(deviceToken); message.setTitle(title); message.setText(text); message.setExtra(extra); androidNotification.setAlert(text); iosNotification.setAlert(text); message.setNotificationAndroid(androidNotification); message.setNotificationIOS(iosNotification); client.send(message); } @Override public void sendListcast(List<String> deviceTokens, String title, String text, JSONObject extra) throws Exception { UMessage message = new UMessage(); message.setDeviceToken(deviceTokens); message.setTitle(title); message.setText(text); message.setExtra(extra); androidNotification.setAlert(text); iosNotification.setAlert(text); message.setNotificationAndroid(androidNotification); message.setNotificationIOS(iosNotification); client.send(message); } @Override public void sendBroadcast(String title, String text, JSONObject extra) throws Exception { UMessage message = new UMessage(); message.setTitle(title); message.setText(text); message.setExtra(extra); androidNotification.setAlert(text); iosNotification.setAlert(text); message.setNotificationAndroid(androidNotification); message.setNotificationIOS(iosNotification); client.send(message); } @Override public void addTag(String deviceToken, String tag) throws Exception { ITagManager tagManager = new TagManager(); tagManager.add(deviceToken, tag); } @Override public void deleteTag(String deviceToken, String tag) throws Exception { ITagManager tagManager = new TagManager(); tagManager.delete(deviceToken, tag); } } ``` 4.在Spring Boot中使用友盟推送: ```java @RestController @RequestMapping("/push") public class PushController { @Autowired private UmengNotificationService umengNotificationService; @PostMapping("/unicast") public void unicast(@RequestParam String deviceToken, @RequestParam String title, @RequestParam String text, @RequestParam JSONObject extra) throws Exception { umengNotificationService.sendUnicast(deviceToken, title, text, extra); } @PostMapping("/listcast") public void listcast(@RequestParam List<String> deviceTokens, @RequestParam String title, @RequestParam String text, @RequestParam JSONObject extra) throws Exception { umengNotificationService.sendListcast(deviceTokens, title, text, extra); } @PostMapping("/broadcast") public void broadcast(@RequestParam String title, @RequestParam String text, @RequestParam JSONObject extra) throws Exception { umengNotificationService.sendBroadcast(title, text, extra); } @PostMapping("/addTag") public void addTag(@RequestParam String deviceToken, @RequestParam String tag) throws Exception { umengNotificationService.addTag(deviceToken, tag); } @PostMapping("/deleteTag") public void deleteTag(@RequestParam String deviceToken, @RequestParam String tag) throws Exception { umengNotificationService.deleteTag(deviceToken, tag); } } ``` 以上代码演示了如何在Spring Boot中使用友盟推送,包括单播、列播、广播和添加/删除标签等操作。需要注意的是,以上代码仅供参考,具体实现需要根据自己的业务需求进行调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值