Image Sharing Using Google Plus in ios

假装没事ソ 提交于 2019-12-03 10:03:45

问题


I want to share image on google plus:

I have used google+ api

AppDelegate.m

[GPPSignIn sharedInstance].clientID = @"MyClientID";
[GPPDeepLink setDelegate:self];
[GPPDeepLink readDeepLinkAfterInstall];

and on button action

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];

but on click it crashes ans error shows:

-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x1e887ea0'

it crashes on [shareBuilder open]


回答1:


It is because you dont have set the other linker Flag, Go to Build Setting and then Other Linker Flags: -ObjC




回答2:


open your build setting of target :

build setting of target >goto linking section > Other linker flag Set other linker flag to : -ObjC

make sure your character should be > -ObjC (matching case) .




回答3:


Amit Bhavsar say the correct. Go to Build Settings, Linking, set in Other Linker Flags, into debug and release, -ObjC. Check that you AppDelegate implement GPPDeepLinkDelegate and your views also.




回答4:


ObjC in other linker flags. And if already add -ObjC try to remove it and again add it. For the 1st time i just copy past -ObjC and it was not working but after removing and again adding it starts working.




回答5:


I have also faced this issue, but finally i found the answer. As above some of friends said, I forgot Add the ObjC linker flag to the app target's build settingss:

So, go to Build Settings page of Targets section of the app, once gone over there, add following in Other Linker Flags

-ObjC

So, this may be helps you Friend!!!




回答6:


you are not assigning client_ id of GPPSignIn class. Try this code in your appdelegate

[GPPSignIn sharedInstance].clientID = @"MY_CLIENT_ID";
[GPPDeepLink setDelegate:self];
[GPPDeepLink readDeepLinkAfterInstall];

then try sharing link for implementing it in right way.



来源:https://stackoverflow.com/questions/17857588/image-sharing-using-google-plus-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!