Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var Ads = cc.Class.extend({
ctor:function(){
ads_plugin = anysdk.agentManager.getAdsPlugin();
if (ads_plugin) {
ads_plugin.setListener(this.onActionResult, this);
ads_plugin.setListener(this.onAdsResult, this);
};
},
preloadAds:function(adType){
Expand All @@ -28,10 +28,6 @@ var Ads = cc.Class.extend({
if ( ads_plugin )
ads_plugin.spendPoints(points);
},
onActionResult:function(param1, param2){
this.onAdsResult(param1, param2);
},

onAdsResult:function(code, msg){
cc.log("on ads result listener.")
cc.log("code:"+code+",msg:"+msg)
Expand Down
14 changes: 9 additions & 5 deletions src/PluginChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ var PluginChannel = cc.Class.extend({

// get plugins
user_plugin = agent.getUserPlugin();
var iapPlugins = anysdk.agentManager.getIAPPlugins();
iap_plugin = agent.getIAPPlugin();
// var iapPlugins = agent.getIAPPlugins(); // 多支付插件时获取所有插件
iap_plugin = agent.getIAPPlugin(); // 单支付插件时获取该唯一的插件
analytics_plugin = agent.getAnalyticsPlugin();
//cc.log("");

if (user_plugin) {
user_plugin.setListener(this.onActionResult, this);
user_plugin.setListener(this.onUserResult, this);
}

if (iap_plugin) {
iap_plugin.setListener(this.onPayResult, this);
}

if(analytics_plugin){
Expand Down Expand Up @@ -119,7 +123,7 @@ var PluginChannel = cc.Class.extend({
iap_plugin.payForProduct(info);

},
onActionResult:function(code, msg){
onUserResult:function(code, msg){
cc.log("on user result listener.")
cc.log("code:"+code+",msg:"+msg)
switch(code)
Expand Down
4 changes: 2 additions & 2 deletions src/Push.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var Push = cc.Class.extend({
push_plugin = anysdk.agentManager.getPushPlugin();
// set share result listener
if (push_plugin)
push_plugin.setListener(this.onActionResult, this);
push_plugin.setListener(this.onPushResult, this);
},
closePush:function(){
push_plugin.closePush();
Expand All @@ -26,7 +26,7 @@ var Push = cc.Class.extend({
delTags:function(){
push_plugin.delTags(["easy","qwe"]);
},
onActionResult:function(code,msg){
onPushResult:function(code,msg){
switch(code)
{
case anysdk.PushActionResultCode.kPushReceiveMessage:
Expand Down
4 changes: 2 additions & 2 deletions src/Social.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var Social = cc.Class.extend({
social_plugin = anysdk.agentManager.getSocialPlugin();
// set share result listener
if (social_plugin)
social_plugin.setListener(this.onActionResult, this);
social_plugin.setListener(this.onSocialResult, this);
},
submitScore:function(){
var score = 131;
Expand All @@ -28,7 +28,7 @@ var Social = cc.Class.extend({
signOut:function(){
social_plugin.signOut();
},
onActionResult:function(code, msg){
onSocialResult:function(code, msg){
cc.log("on social result listener.")
cc.log("code:"+code+",msg:"+msg)
switch(code)
Expand Down