This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.microsoft.windowsazure.messaging.*; | |
import com.microsoft.windowsazure.notifications.*; | |
//full source at https://github.com/sedouard/AMSCrossPlatPush/blob/master/GoogleAndriod/CrossPlatformPush/src/com/example/crossplatformpush/MainActivity.java | |
public class MainActivity extends ActionBarActivity { | |
private final String PROJECT_NUMBER = "<YOUR PROJECT NUMBER FROM GOOGLE PLAY>"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.crossplatformpush; | |
import android.content.Context; | |
import com.microsoft.windowsazure.notifications.NotificationsHandler; | |
import com.microsoft.windowsazure.messaging.*; | |
public class Handler extends NotificationsHandler { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var azure = require('azure'); | |
//call POST https://<service-name>.azure-mobile.net/api/<endpoint name> with the tag you want in the query parameter | |
exports.post = function(request, response) { | |
var hub = azure.createNotificationHubService("crossplatpushdemohub", "Endpoint=sb://crossplatpushdemohub-ns.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=AGeyP6352Hg585VK88XkjrXwKy37st/dp4xVGrpdyO4="); | |
var sendMessage = function(tag, message){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows.Security.Authentication.Web.WebAuthenticationBroker | |
.authenticateAsync(Windows.Security.Authentication.Web.WebAuthenticationOptions.default, startURI, endURI) | |
.then(function(result){ | |
console.log('handle your provider specific token inside ' + result.responseData); | |
}, function(error){ | |
console.error(error); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
//Windows 8/8.1 | |
Windows.Security.Authentication.Web.WebAuthenticationBroker | |
.authenticateAsync(Windows.Security.Authentication.Web.WebAuthenticationOptions.default, startURI, endURI) | |
.then(function(result){ | |
console.log('handle your provider specific token inside ' + result.responseData); | |
}, function(error){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.addEventListener("activated", function (args) { | |
if (args.detail.kind == activation.ActivationKind.webAuthenticationBrokerContinuation) { | |
//take oauth response and continue login process | |
mobileSerivce.login(args.detail.webAuthenticationResult); | |
} | |
//Handle normal activiation...(hidden) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
import serializer from '../serializers/azure-storage'; | |
import accountUtils from '../utilities/account'; | |
export default DS.Adapter.extend({ | |
serializer: serializer.create(), | |
nodeServices: Ember.inject.service(), | |
find: function (store, type, snapshot) { | |
var blobService = this.get('azureStorage').createBlobService(store.account_name, store.account_key); | |
return new Ember.RSVP.Promise(function (resolve, reject) { | |
blobService.getBlobProperties(snapshot.get('container').name, snapshot.get('name'), function (error, result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
var azureStorage = null; | |
var fs = null; | |
// check if running in nw, if not, we're probably running as a test | |
// in which case this entire service will be mocked | |
if (window.requireNode) { | |
azureStorage = window.requireNode('azure-storage'); | |
fs = window.requireNode('fs'); | |
} | |
export default Ember.Service.extend({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodeServices.set('azureStorage', { | |
createBlobService: function () { | |
return { | |
listContainersSegmented: function (shouldBeNull, callback){ | |
assert.ok(shouldBeNull === null, 'expeceted arg shouldBeNull to be null'); | |
assert.ok(callback !== null, 'expeceted arg callback to be non-null'); | |
return callback(null, { | |
entries: [{ | |
name: 'testcontainer', | |
properties: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start app in test mode with mocked services | |
import startApp from 'azureexplorer/tests/helpers/start-app'; | |
// Replace this with your real tests. | |
test('it should give us models', function(assert) { | |
assert.expect(2); | |
App = startApp(null, assert); | |
store = App.__container__.lookup('store:main'); | |
Ember.run(function(){ | |
var newAccount = store.createRecord('account', { | |
name: 'Testaccount', |
OlderNewer