Chitra Khatri
Chitra Khatri

Reputation: 1258

Image Sharing Using Google Plus in ios

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]

Upvotes: 13

Views: 5304

Answers (6)

Alok
Alok

Reputation: 25938

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) .

Upvotes: 10

Anilkumar iOS Developer
Anilkumar iOS Developer

Reputation: 3755

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!!!

Upvotes: 1

souvickcse
souvickcse

Reputation: 7804

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.

Upvotes: 1

Jaime Leon
Jaime Leon

Reputation: 21

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.

Upvotes: 1

Amit Bhavsar
Amit Bhavsar

Reputation: 1273

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

Upvotes: 38

Shekhar Gupta
Shekhar Gupta

Reputation: 6218

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.

Upvotes: 0

Related Questions