|
IOS“活动”APP客户端添加教程(微信中使用其他应用打开...
[复制链接]
本帖最后由 1321390003@qq.c 于 2016-10-27 17:05 编辑
微信发送的文件要转存到QQ里面,我们一般都会直接下载文件后长按或者点击右上角的“。。。”转发到QQ中,那用APICLOUD怎么实现这样的功能呢?其实这里专业的名词在IOS里面叫活动,apicloud已经对这个功能进行了相应的封装。
比如下面的微信右边,QQ左边的应用快捷方式。叫彩虹能源。用它来打开
其实很简单,只需要两步就可以了:官方修改Info.plist文件教程
https://community.apicloud.com/bbs/forum.php?mod=viewthread&tid=20
1.添加Info.plist文件,配置好可以打开的文件类型。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>org.openxmlformats.openxml</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>officeopenxml</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>data</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.powerpoint.ppt</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>ppt</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.word.doc</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>doc</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.excel.xls</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>xls</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>pdf</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>org.gnu.gnu-tar-archive</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>archive</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>public.audiovisual-content</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>audivideo</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>public.image</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>image</string>
</dict>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>public.text</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeName</key>
<string>txt</string>
</dict>
</array>
</dict>
</plist>
里面的配置文件可以自己根据实际需求修改下。
2.在APP的index.html中添加appintent事件监听。
很简单的几行代码就搞定了
api.addEventListener({
name: 'appintent',
}, function(ret){
api.alert({
title: '传过来的东西哦',
msg: ret,
});
});
这里从ret中取出想要的东西自己做处理就好了。
当然自己可以做其他扩展。这里做的是很简单的,走通流程就好了。
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|