【ANE】艾媒-17wo安卓ANE接入
艾媒-17wo 据说这个是联想的还是什么的,反正不知道咯。商务 给的SDK,我说过我们接SDK 首选 易接 易接没有自己搞。然而易接确实没有,当然有个好处是 你可以把SDK给易接 让他添加。不好意思帮别人打了个广告。
但是,易接怪,他们不接包含依赖包的SDK。于是乎易接和艾媒在商量,于是乎出现了 艾媒说这个SDK是以前的人写的 人走茶凉 没法改咯,易接说没法改那么我们就没法接咯。最后就只有靠自己了。摸索之后放出ANE
配置如下 可以参考给的SDKdemo 一回事儿
<manifest android:installLocation="auto"> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.GET_TASKS" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.WRITE_APN_SETTINGS" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.SEND_SMS" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <application android:allowBackup="true" > <meta-data android:name="APP_ID" android:value="my app_id" /> <meta-data android:name="APP_KEY" android:value="my app_key" /> <meta-data android:name="APP_SECRET" android:value="MY app_secret" /> <meta-data android:name="CHANNEL_ID" android:value="33" /> <activity android:name="com.future.playgame.coin.ui.PlayGCActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" /> <activity android:name="com.unicom.woopenchannelsmspayment.UnicomWoOpenPaymentMainActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:screenOrientation="portrait" android:windowSoftInputMode="stateAlwaysHidden|adjustPan" > </activity> <activity android:name="com.unicom.woopenchannelsmspayment.UnicomSMSSuccessActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" android:screenOrientation="portrait" /> <activity android:name="com.unicom.woopenchannelsmspayment.UnicomSMSFaildActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTop" android:screenOrientation="portrait" /> <activity android:name="com.alipay.sdk.app.H5PayActivity" android:configChanges="orientation|keyboardHidden|navigation" android:exported="false" android:screenOrientation="behind" android:windowSoftInputMode="adjustResize|stateHidden" > </activity> <activity android:name="com.alipay.sdk.auth.AuthActivity" android:configChanges="orientation|keyboardHidden|navigation" android:exported="false" android:screenOrientation="behind" > </activity> <meta-data android:name="CHINA_UNICOM_MOBILE_CHANNEL" android:value="23" /> </application> </manifest>
初始化SDK
public function initSDK( appID:int,appKey:String,appName:String ):void
支付 商品 ID 、价格、商品数量、商品名称、商品描述
public function pay( id:int,price:Number,count:int,name:String,description:String ):void
是否显示悬浮窗
public function handleFloatView( isShow:Boolean ):void
登出 /注销
public function loginOut( ):void
查询订单
public function queryOrder( ):void
下面是事件
public static const STATUS:String = "status";//这个是转发了一次自带的状态事件 public static const INIT_SUS:String = "init_sus";//这个是初始化成功之后会派发 其实在状态事件里面也有只是我单独提取了出来 public static const PAY_SUS:String = "pay_sus";//支付成功事件 同样 和 初始化成功一样
在事件里面 有个 WoInfo 的变量 里面可以获取到一些必要的信息
下面是WoInfo的内部结构
public var mmid:String; public var authCode:String; public var acountName:String; public var channelId:String; public var isLogined:Boolean; public var appID:String; public var appKey:String; public var appSecret:String;