This file contains hidden or 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
func subscribeChannel(channel: String) { | |
if (appDelegate.ortc?.isConnected() == true) { | |
appDelegate.ortc?.subscribe(channel) | |
} else { | |
print("Ortc not connected yet.") | |
} | |
} | |
func sendMessage(channel: String, message: String) { | |
if (appDelegate.ortc?.isConnected() == true) { |
This file contains hidden or 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
let appDelegate: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate |
This file contains hidden or 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 UIKit | |
import Parse | |
@UIApplicationMain | |
class AppDelegate: RealtimePushAppDelegate { | |
var ortc: OrtcClass? | |
var notifications:NSMutableDictionary = NSMutableDictionary() | |
override func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { |
This file contains hidden or 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 ortc: OrtcClass? |
This file contains hidden or 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 UIKit | |
class OrtcClass: NSObject, OrtcClientDelegate{ | |
let APPKEY = "YOUR_APP_KEY" | |
let TOKEN = "TOKEN" | |
let METADATA = "METADATA" | |
let URL = "https://ortc-developers.realtime.co/server/ssl/2.1/" | |
var ortc: OrtcClient? | |
var onMessage:AnyObject? |
This file contains hidden or 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
#ifndef Bridging_Header_h | |
#define Bridging_Header_h | |
#import “OrtcClient.h” | |
#import <RealtimePushAppDelegate.h> | |
#endif /* Bridging_Header_h */ |
This file contains hidden or 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
subscribeButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
subscribeOrtc(); | |
} | |
}); | |
messageButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { |
This file contains hidden or 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
subscription = new SubscriptionHandler(this); | |
Button subscribeButton = (Button) findViewById(R.id.subscribeButton); | |
Button messageButton = (Button) findViewById(R.id.messageButton); |
NewerOlder