Chi*_*tri 13 iphone ios google-plus socialshare
我想在google plus上分享图片:
我用过google + api
AppDelegate.m
[GPPSignIn sharedInstance].clientID = @"MyClientID";
[GPPDeepLink setDelegate:self];
[GPPDeepLink readDeepLinkAfterInstall];
Run Code Online (Sandbox Code Playgroud)
并按下按钮动作
ViewController.m
id<GPPShareBuilder> shareBuilder = [[GPPShare sharedInstance] shareDialog];
[shareBuilder setURLToShare:[NSURL URLWithString:@"http://dummy.com"]];
[shareBuilder setTitle:@"Some title" description:@"Some description" thumbnailURL:[NSURL URLWithString:@"http://dummy.com/image"]];
[shareBuilder setContentDeepLinkID:@"MyclientID"];
[shareBuilder open];
Run Code Online (Sandbox Code Playgroud)
但点击它崩溃和错误显示:
-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x1e887ea0'
Run Code Online (Sandbox Code Playgroud)
它崩溃了[shareBuilder open]
Ami*_*sar 38
这是因为你没有设置其他链接器Flag,转到Build Setting然后设置 Other Linker Flags:-ObjC
您没有分配 GPPSignIn 类的 client_ id 。在您的 appdelegate 中尝试此代码
[GPPSignIn sharedInstance].clientID = @"MY_CLIENT_ID";
[GPPDeepLink setDelegate:self];
[GPPDeepLink readDeepLinkAfterInstall];
Run Code Online (Sandbox Code Playgroud)
然后尝试分享链接以正确的方式实施它。
| 归档时间: |
|
| 查看次数: |
5275 次 |
| 最近记录: |