Skip to content

Commit

Permalink
Added example to app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
timanrebel committed Jul 3, 2014
1 parent ec8bd0a commit b685c14
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions android/example/app.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,10 @@
// This is a test harness for your module
// You should do something interesting in this harness
// to test out the module and to provide instructions
// to users on how to use it by example.


// open a single window
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
var label = Ti.UI.createLabel();
win.add(label);
win.open();

// TODO: write your module tests here
var Parse = require('eu.rebelcorp.parse');
Ti.API.info("module is => " + Parse);

label.text = Parse.example();

Ti.API.info("module exampleProp is => " + Parse.exampleProp);
Parse.exampleProp = "This is a test value";
Parse.start('<PARSE-APPLICATION-ID>', '<PARSE-CLIENT-ID>');

if (Ti.Platform.name == "android") {
var proxy = Parse.createExample({
message: "Creating an example Proxy",
backgroundColor: "red",
width: 100,
height: 100,
top: 100,
left: 150
});
// To enable Android Push Notifications
Parse.enablePush();

proxy.printMessage("Hello world!");
proxy.message = "Hi world!. It's me again.";
proxy.printMessage("Hello world!");
win.add(proxy);
}
// Subscribe of unsubscribe to Parse Channels
Parse.subscribeChannel('user_123');

Parse.unsubscribeChannel('user_123');

0 comments on commit b685c14

Please sign in to comment.