13

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]

Midhun MP
  • 103,496
  • 31
  • 153
  • 200
Chitra Khatri
  • 1,260
  • 2
  • 14
  • 31

6 Answers6

38

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

Amit Bhavsar
  • 1,273
  • 12
  • 23
  • 3
    Silly points we miss -- I had made the flag "-Objc".. changed it to "-ObjC" and it worked. – Shailesh Feb 04 '15 at 11:32
  • 1
    I have added google+ and facebook sign in both, now if i add -ObjC then facebook sdk starts giving errors, whats the middle way to support both – Mehul Thakkar Sep 16 '15 at 19:53
10

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

Alok
  • 24,880
  • 6
  • 40
  • 67
1

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.

Jaime Leon
  • 21
  • 1
1

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.

souvickcse
  • 7,742
  • 5
  • 37
  • 64
1

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

0

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.

Shekhar Gupta
  • 6,206
  • 3
  • 30
  • 50