最新ShareSdk简洁版集成注意事项(IOS)

集成过程遇到的问题

工程跑不起来

文件都按照官方文档拖拽进去、依赖的系统框架也都添加完毕,提示找不到引用框架。
最新ShareSdk简洁版集成注意事项(IOS)_第1张图片
出现此问题是因为虽然你把文件拖进去了,但工程仍找不到你引用框架所在的位置,我用的是xcode7.0测试版本,估计其他版本不会出现这个问题。解决办法如下:
找到工程中的这两项(默认是空的)
最新ShareSdk简洁版集成注意事项(IOS)_第2张图片
分别添加拖拽文件夹锁在的目录:
Framework Search Paths
最新ShareSdk简洁版集成注意事项(IOS)_第3张图片
Library Search Paths
最新ShareSdk简洁版集成注意事项(IOS)_第4张图片
然后项目就可以run起来啦。
错误的代码:

Ld /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphonesimulator/MobTest3.app/MobTest3 normal x86_64
    cd /Users/wangdalei/IOS/MobTest3
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphonesimulator -F/Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphonesimulator -filelist /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Intermediates/MobTest3.build/Debug-iphonesimulator/MobTest3.build/Objects-normal/x86_64/MobTest3.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -lsqlite3 -framework ImageIO -framework JavaScriptCore -lstdc++ -lz -licucore -framework MOBFoundation -framework ShareSDKConnector -framework TencentOpenAPI -framework ShareSDKUI -lWeiboSDK -framework ShareSDKExtension -lWeChatSDK -framework ShareSDK -Xlinker -dependency_info -Xlinker /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Intermediates/MobTest3.build/Debug-iphonesimulator/MobTest3.build/Objects-normal/x86_64/MobTest3_dependency_info.dat -o /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphonesimulator/MobTest3.app/MobTest3

ld: framework not found MOBFoundation
clang: error: linker command failed with exit code 1 (use -v to see invocation)

项目跑起来了引用新浪微博头文件时又报错

如图,出现此问题是因为按照官方文档引用的系统框架,官方少写了一个:AdSupport.framework,引用一下就可以了。
错误信息如下:
最新ShareSdk简洁版集成注意事项(IOS)_第5张图片
错误代码:

Ld /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphoneos/MobTest3.app/MobTest3 normal armv7
    cd /Users/wangdalei/IOS/MobTest3
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphoneos -L/Users/wangdalei/IOS/MobTest3/libraries/extends/SinaWeiboSDK -L/Users/wangdalei/IOS/MobTest3/libraries/extends/WeChatSDK -F/Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphoneos -F/Users/wangdalei/IOS/MobTest3/libraries/extends/QQSDK -F/Users/wangdalei/IOS/MobTest3/libraries -filelist /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Intermediates/MobTest3.build/Debug-iphoneos/MobTest3.build/Objects-normal/armv7/MobTest3.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -ObjC -fobjc-arc -fobjc-link-runtime -lsqlite3 -framework ImageIO -framework JavaScriptCore -lstdc++ -lz -licucore -framework MOBFoundation -framework ShareSDKConnector -framework TencentOpenAPI -framework ShareSDKUI -lWeiboSDK -framework ShareSDKExtension -lWeChatSDK -framework ShareSDK -Xlinker -dependency_info -Xlinker /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Intermediates/MobTest3.build/Debug-iphoneos/MobTest3.build/Objects-normal/armv7/MobTest3_dependency_info.dat -o /Users/wangdalei/Library/Developer/Xcode/DerivedData/MobTest3-crzhmpylhszbsihkijdeyjfobcub/Build/Products/Debug-iphoneos/MobTest3.app/MobTest3

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in libWeiboSDK.a(WBSDKGetDeviceIdSDK.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

集成注意事项

(1)《iOS9对ShareSDK的影响(iOS9适配必看)》、《ShareSDK简洁版集成文档》和官方的DEMO是必须要看的,熟悉一下!
(2)注册新浪、腾讯QQ、微信各个平台的开发者账号挺烦的,除了微信的其它两个即使不审核通过也可以用来开发测试使用。
(3)刚开始使用的是sdk提供的菜单,但是有点不稳定,就是分享菜单的排序不是按照AppDelegate.m中注册的activePlatforms顺序显示的,有电乱,而且在模拟器和真机上又的现实又的不现实。所以后来我重新写了一下。
(4)简洁版的SSO,比以前简单多了。目前QQ和微信只支持SSO,新浪微博支持SSO和网页(可配置)。以前集成SSO还需要在AppDelegate.m中配置一堆,现在只需要在info.plist中添加回调就可以:

把注册的各种id在AppDelegate配置下就OK
最新ShareSdk简洁版集成注意事项(IOS)_第6张图片

DEMO下载地址: http://download.csdn.net/detail/daleiwang/9227231

你可能感兴趣的:(xcode,ShareSDK,IOS9,MOB,第三方分享)