ylxb 2016-05-10 01:45 采纳率: 0%
浏览 1977

cordova分享插件在iOS平台下分享的时候出问题

在Android平台上能正常分享,在ios平台下分享报异常。
分享到QQ代码如下:
window.plugins.socialsharing.shareVia('com.tencent.mobileqq', '分享来自上海气象博物馆。', null, $scope.$parent.picture.src, null, function() {
console.log('share ok')
}, function(msg) {
alert(msg);
});
报错信息如下:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target .
求做过或者遇到的给点帮助

  • 写回答

2条回答

  • ylxb 2016-05-10 06:56
    关注

    经过测试发现,方法是正确的但是方法的第一个参数是错误的,导致数组中没有这个参数NSInvalidArgumentException,因此报错,但是安装github 上的readme.md
    文件中,没有关于分享到ios平台下的扣扣的相关说明,只有新浪微博,腾讯微博的相关说明:iOS: You are limited to 'com.apple.social.[facebook | twitter | sinaweibo | tencentweibo]'. If an app does not exist, the errorcallback is invoked and iOS shows a popup message asking the user to configure the app.
    修改第一个参数代码为:com.apple.social.sinaweibo 后即可分享到新浪微博,腾讯微博也可以分享,但是facebook 和Twitter 按照这种写法,时候依然报错,表示不解,而分享到QQ ,微信,微信朋友圈的ios 平台没有说明,只有Android的亲测,可以分享成功,但是在IOS下不知道如何书写,也没有可以供参考的代码·····,只能到此为止吧,希望遇到此需求的朋友们可以提供,或者给出意见或者建议······

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler