chrisribe / ti-firebase

Appcelerator / Titanium module project to build and use the google firebase SDK
Other
33 stars 14 forks source link

setUserPropertyString causes "unrecognized selector sent to instance" #1

Closed chrisribe closed 8 years ago

chrisribe commented 8 years ago

There is currently an issue where I get this error when calling "setUserPropertyString"

[56051:22661535] -[__NSDictionaryM objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x7f85e6777e20

I get around the error by setting the + (class symbol) in front of the method. But I dont know objective-c enough to know better or why this works. So could someone take a look and point out my error / issue, thanks.


+(void)setUserPropertyString:(id)args{ ENSURE_UI_THREAD_1_ARG(args); ENSURE_ARG_COUNT(args, 1);

NSDictionary *dict = args[0];

NSString *value = dict[@"value"];//<-- here
NSString *name = dict[@"name"];

//NSLog(@"[INFO] set property string: value:%@, name:%@", value, name);
[FIRAnalytics setUserPropertyString:value
    forName:name];

}

hansemannn commented 8 years ago

The method signature should be -(void)setUserPropertyString:(id)arg. I attempted a fix in #6, please give it a try.

chrisribe commented 8 years ago

Re-tested and fixed. Thanks a bunch !