Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18712] Facebook module: upgrade iOS Facebook SDK and improve requestDialog

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-04-21T02:59:14.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsAndroid, iOS
Labelsn/a
ReporterChee Kiat Ng
AssigneeEric Merriman
Created2015-03-18T04:56:20.000+0000
Updated2017-03-20T18:09:47.000+0000

Description

There is a request on github that we should expose the 'resultURL' from presentRequestDialog method. Also, we should upgrade the Facebook sdk in the iOS module from 3.21.1 to 3.23.1.
var fb = require('facebook');

var win = Ti.UI.createWindow({
	title: 'RequestDialog',
	backgroundColor:'#fff',
	fullscreen: false
});

var requestDialog = Ti.UI.createButton({
	title: 'Request Dialog',
	top: 180, left: 10, right: 10, height: 40
});

requestDialog.addEventListener('click', function() {
	fb.presentSendRequestDialog( 
		{message: 'Go to https://appcelerator.com/'}, 
		{data:
        "{\"badge_of_awesomeness\":\"1\"," +
        "\"social_karma\":\"5\"}"});
});

fb.addEventListener('requestDialogCompleted', function(e) {
	if (e.success) {
		alert('Request dialog completed. Returned URL is ' + e.resultURL);
	}
	else if (e.cancelled) {
		alert('Request dialog cancelled');
	}
	else {
		alert('error ' + e.error);           
	}
});

win.add(requestDialog);
win.open();

Comments

  1. Chee Kiat Ng 2015-03-18

    Done during HackNight! PR here: https://github.com/appcelerator-modules/ti.facebook/pull/7 [~msamah], please help with the android component.
  2. Ashraf Abu 2015-03-18

    Will do.
  3. Chee Kiat Ng 2015-04-15

    Facebook iOS SDK has upgraded to version 4.0.1 on April 2nd 2015. To be considered for this improvement.
  4. Fokke Zandbergen 2015-04-20

    [~cng] This resultURL also has the recipient user IDs as described [here](https://developers.facebook.com/docs/games/requests/v2.2#response) right? I could really use this update, for Android as well. Any eta on it?
  5. Chee Kiat Ng 2015-04-21

    [~fokkezb] just merged the pr. https://github.com/appcelerator-modules/ti.facebook/pull/12 yes the resultURL returns the recipient user iDs.
  6. Fokke Zandbergen 2015-04-21

    [~cng] excellent, how about Android? ;)
  7. Chee Kiat Ng 2015-04-21

    It's there too sir
  8. Fokke Zandbergen 2015-04-21

    [~cng] A sorry, I was mislead by the title of the PR which only spoke about Android. Awesome!, I'll give it a try.
  9. Lee Morris 2017-03-20

    Closing ticket as fixed.

JSON Source