小游戏怎么分辨是转发分享到个人还是群组
wx.shareAppMessage({ title: "" , path: '/pages/share/share?id=123' , imageUrl: '/res/share.jpg' , success(res){ console.log( "转发成功!!!" ); if (res.shareTickets == null || res.shareTickets == undefined || res.shareTickets == "" ){ console.log( "res.shareTickets is null" ); cc.log( "你分享到个人而不是群" ) } else { console.log( "res.shareTickets is not null" ); if (res.shareTickets.length > 0){ cc.log( "成功分享到群里" ) } } }, fail(res){ console.log( "转发失败!!!" ); } }) |
这样写的话是只有在群里面有消息的时候才能辨别出来是群组,当群里面没有消息的时候res.shareTickets = undefined ,
请问还有别的方法区分吗?