Titanium JIRA Archive
Alloy (ALOY)

[ALOY-893] social.js update to REST API 1.1

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2014-03-04T21:30:27.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTooling
Labelssocial.js
ReporterMauro Parra-Miranda
AssigneeTim Poulsen
Created2013-12-03T00:40:17.000+0000
Updated2018-03-07T22:28:27.000+0000

Description

When using the doc example for Alloy.builtin.social, when trying to authorize the app created via the Dev Twitter website, Twitter gives an error regarding the REST API version used which should be 1.1 instead of 1.0. Modifying the generated social.js file located in /Resources/alloy fix the issue but a new social.js file in generated everytime the app is compiled. See attachment.

Attachments

FileDateSize
Capture d’écran 2013-12-03 à 01.39.49.png2013-12-03T00:40:17.000+000075961

Comments

  1. Tim Poulsen 2014-03-04

    Using the code below, I can successfully interact with the Twitter API using Alloy 1.3.1 and Ti SDK 3.2.1.GA. I can authorize the app and send a tweet. Additionally, code in social.js points to https://api.twitter.com/1.1/statuses/update.json I'm closing this as invalid, though I think it was fixed as part of another ticket.
       <Alloy>
       	<Window>
       		<Button id="btn" title="Tweet a message" onClick="tweet"/>
       	</Window>
       </Alloy>
       
       var social = require('alloy/social').create({
         consumerSecret: 'SECRET_KEY',
         consumerKey: 'CONSUMER_KEY'
       });
       
       if(!social.isAuthorized()) {
           social.authorize();
       	}
       
       function tweet() {
       	social.share({
       		message: "Test from social.js",
       		success: function(e) {alert('Success!');},
       		error: function(e) {alert('Error!');}
       	});
       }
       
       // Deauthorize the application
       social.deauthorize();
       
       $.index.open();
       
  2. Eric Merriman 2018-03-07

    Closing as invalid. If this is incorrect, please reopen.

JSON Source