This is my xml i have the production/developer keys in the right place i'm not sure if i put the <modules> <module platform="commonjs" version="2.0.1">ti.cloud</module> </modules> in the right place its currently placed under <iphone>
<?xml version="1.0" encoding="UTF-8"?> <ti:app xmlns:ti="http://ti.appcelerator.org"> <property name="acs-oauth-secret-production" type="string">"i have the right key here"</property> <property name="acs-oauth-key-production" type="string">"i have the right key here"</property> <property name="acs-api-key-production" type="string">"i have the right key here"</property> <property name="acs-api-key-development" type="string">"i have the right key here"</property> <property name="acs-oauth-key-development" type="string">"i have the right key here"</property> <property name="acs-oauth-secret-development" type="string">"i have the right key here"</property> <deployment-targets> <target device="mobileweb">true</target> <target device="iphone">true</target> <target device="ipad">true</target> <target device="android">true</target> </deployment-targets> <sdk-version>2.1.0.GA</sdk-version> <id>com.test2</id> <name>test2</name> <version>1.0</version> <publisher>shane</publisher> <url>http://</url> <description>not specified</description> <copyright>2012 by shane</copyright> <icon>appicon.png</icon> <persistent-wifi>false</persistent-wifi> <prerendered-icon>false</prerendered-icon> <statusbar-style>default</statusbar-style> <statusbar-hidden>false</statusbar-hidden> <fullscreen>false</fullscreen> <navbar-hidden>false</navbar-hidden> <analytics>true</analytics> <guid>61ab181d-ab6a-4948-a6f2-6a7faba92c69</guid> <property name="ti.ui.defaultunit">system</property> <iphone> <modules> <module platform="commonjs" version="2.0.1">ti.cloud</module> </modules> <orientations device="iphone"> <orientation>Ti.UI.PORTRAIT</orientation> </orientations> <orientations device="ipad"> <orientation>Ti.UI.PORTRAIT</orientation> <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation> <orientation>Ti.UI.LANDSCAPE_LEFT</orientation> <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation> </orientations> </iphone> <android xmlns:android="http://schemas.android.com/apk/res/android"/> <mobileweb> <precache/> <splash> <enabled>true</enabled> <inline-css-images>true</inline-css-images> </splash> <theme>default</theme> </mobileweb> </ti:app>here is my code that should create a new user but it keeps alerting as "Fail"
var winsignup = Titanium.UI.createWindow({ title:'Sign Up!', tabBarHidden:true, borderRadius:0, backgroundColor:'#336699' }); var label = Ti.UI.createLabel({ text: 'Sign Up!', color: '#fff', top:0, textAlign:'center', font: { fontWeight: 'bold', fontSize: 18 }, height:'auto', }); winsignup.add(label); var userNameField = Titanium.UI.createTextField({ color:'#336699', top:50, left:10, width:300, height:40, hintText:'userNameField', borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); winsignup.add(userNameField); var passwordField = Titanium.UI.createTextField({ color:'#336699', top:100, left:10, width:300, height:40, hintText:'passwordField', passwordMask:true, borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); winsignup.add(passwordField); var passwordConfirmation = Titanium.UI.createTextField({ color:'#336699', top:150, left:10, width:300, height:40, hintText:'passwordConfirm', passwordMask:true, borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); winsignup.add(passwordConfirmation); var firstName = Titanium.UI.createTextField({ color:'#336699', top:200, left:10, width:300, height:40, hintText:'firstName', borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); winsignup.add(firstName); var lastName = Titanium.UI.createTextField({ color:'#336699', top:250, left:10, width:300, height:40, hintText:'lastName', borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED }); winsignup.add(lastName); var Create = Titanium.UI.createButton({ title:'Create', top:300, width:90, height:35, borderRadius:1, font:{fontWeight:'bold',fontSize:14} }); winsignup.add(Create); winsignup.open(); Create.addEventListener('click', function() { Cloud.Users.create ({ username: userNameField.value, password: passwordField.value, password_confirmation : passwordConfirmation.value, firstName: firstName.value, lastName: lastName.value, }, function (e) { if (e.success) { alert('Success'); } else { alert('Fail'); } }); });any ideas?
Your Answer
Think you can help? Login to answer this question!