0
votes

I am currently developing an app using Appcelerator Studio and want to track installs with the Facebook Module: http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook

The app does not require Facebook login so I need to track installs without the login function (If i call the .authorize function the install is tracked, but this isn't what I want)

I have tried a couple of ways:

1.  var fb = require('facebook');
    fb.initialize();
    fb.activateApp();

Nothing appears in the Facebook analytics section but no errors are thrown.

2.  var fb = require('facebook');
    fb.initialize();
    fb.logCustomEvent('test');

with iOS I get the error:

[ERROR] : message = "-[__NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x799633e0";

Even though the documentation requires passing the event as a string as I am doing.

Any help would be much appreciated.

Many Thanks, Simon.

2
Problem is clearly telling that NSString has not method objectAtIndex: , You are expecting an Array but your are getting String. - Muhammad Waqas Bhati
Hi, thank you for your response, I am afraid not, the documentation for the Facebook module for titanium explicitly says to set the event as an "Arbitrary string to log as an event." which is exactly what I do and yet I get this error. - SJDenny
It appears as though you're doing everything correct. What version is your Facebook module? I wonder if this has anything to do with your error: github.com/appcelerator-modules/ti.facebook/pull/26 Also, see this JIRA. Maybe this needs to be reopened: jira.appcelerator.org/browse/TC-5564 - Nathan Follmer
Hi Nathan, thank you for the response and sorry for the delay. I am using module number 4.0.5 I will take a look at getting the ticket mentioned reopened. Can you confirm if you've done anything similar to what I am looking at doing? - SJDenny

2 Answers

0
votes

I have a fix, but I need someone to explain me how to make a separate pull request for it.

Right now I fixed it in-house and attached it to the end of my other pull request:

https://github.com/appcelerator-modules/ti.facebook/pull/37

It crashes because we use objectAtIndex on the object that we just assured is NSString (congrats)

0
votes

The PR was merged last week and will be included in the next Ti.Facebook update.