Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1546] Alloy.builtins.social: Unable to get Twitter user info

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-12-04T15:27:20.000+0000
Affected Version/salloy 1.9.5
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterNazmus Salahin
AssigneeFeon Sua Xin Miao
Created2017-03-12T17:25:11.000+0000
Updated2018-12-04T15:27:20.000+0000

Description

Hi, We are trying to get Twitter user info using following documentation: http://docs.appcelerator.com/platform/latest/#!/api/Alloy.builtins.social Steps : 1. Create a simple alloy project. 2. Add following code:
var social = require('alloy/social').create({
	consumerSecret :'yyy',
	consumerKey : 'zzzz'
});

function doClick(e) {
	if (!social.isAuthorized()) {
		social.authorize(function(e) {
			alert(JSON.stringify(e));
		});
	}
}
$.index.open();
3. After Authorize apps. [^0-sa-d2-9e99ac3363469698d457463077931f46.jpg] 4. It said enter that pin number !Screenshot_20170312-231225.png|thumbnail! 5. Where to put that pin number ?

Attachments

FileDateSize
0-sa-d2-9e99ac3363469698d457463077931f46.jpg2017-03-12T17:27:37.000+000084011
Screenshot_20170312-231225.png2017-03-12T17:27:38.000+0000203296

Comments

  1. Nazmus Salahin 2017-04-04

    Hi, Is there any update on this issue?
  2. Feon Sua Xin Miao 2017-04-04

    On Android, evalJS returns following error:
        Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src https://abs.twimg.com https://abs-0.twimg.com https://twitter.com https://mobile.twitter.com".
       
    Looks like there's no way the builtins can scrape auth PIN from the page. One possible solution is to add an input box for users to key in the pin, though this will change user experience completely.

JSON Source