[sword-svn] r3588 - in trunk/bindings: cordova/org.crosswire.sword.cordova.SWORD/src/ios objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad

scribe at crosswire.org scribe at crosswire.org
Sat Jun 16 07:21:48 MST 2018


Author: scribe
Date: 2018-06-16 07:21:48 -0700 (Sat, 16 Jun 2018)
New Revision: 3588

Modified:
   trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/ios/SWORD.swift
   trunk/bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad/UserInterfaceState.xcuserstate
Log:
updated Swift bindings to work with lastest bibleSync


Modified: trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/ios/SWORD.swift
===================================================================
--- trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/ios/SWORD.swift	2018-06-16 14:17:57 UTC (rev 3587)
+++ trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/ios/SWORD.swift	2018-06-16 14:21:48 UTC (rev 3588)
@@ -453,18 +453,33 @@
     @objc(SWMgr_startBibleSync:)
     func SWMgr_startBibleSync(command: CDVInvokedUrlCommand) {
         initMgr()
-        let appName = command.arguments[1] as? String ?? ""
-        let userName = command.arguments[2] as? String ?? ""
-        let passphrase = command.arguments[3] as? String ?? ""
+        let appName = command.arguments[0] as? String ?? ""
+        let userName = command.arguments[1] as? String ?? ""
+        let passphrase = command.arguments[2] as? String ?? ""
             bibleSyncCallbackID = command.callbackId
             DispatchQueue.global().async {
                 mySWORDPlugin = self
-                org_crosswire_sword_SWMgr_startBibleSync(self.mgr, appName, userName, passphrase, { (message: Optional<UnsafePointer<Int8>>) in
-                    let response = String(cString: message!)
+                org_crosswire_sword_SWMgr_startBibleSync(self.mgr, appName, userName, passphrase, { (cmd : Int8, str1: Optional<UnsafePointer<Int8>>, str2: Optional<UnsafePointer<Int8>>) in
+                    let response1 = String(cString: str1!)
+                    let response2 = String(cString: str2!)
                     if (mySWORDPlugin != nil && mySWORDPlugin!.bibleSyncCallbackID != "") {
-                        let result = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: response)
-                        result?.setKeepCallbackAs(true)
-                        mySWORDPlugin!.commandDelegate!.send(result, callbackId: mySWORDPlugin!.bibleSyncCallbackID)
+			if (cmd == CChar("N")) {
+				var retVal = [String:Any]()
+				retVal["cmd"]     = "nav";
+				retVal["osisRef"] = response1;
+				let result = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: retVal)
+				result?.setKeepCallbackAs(true)
+				mySWORDPlugin!.commandDelegate!.send(result, callbackId: mySWORDPlugin!.bibleSyncCallbackID)
+			}
+			else if (cmd == CChar("C")	) {
+				var retVal = [String:Any]()
+				retVal["cmd"]     = "chat";
+				retVal["user"]    = response1;
+				retVal["message"] = response2;
+				let result = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: retVal)
+				result?.setKeepCallbackAs(true)
+				mySWORDPlugin!.commandDelegate!.send(result, callbackId: mySWORDPlugin!.bibleSyncCallbackID)
+			}
                     }
                 });
                 

Modified: trunk/bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad/UserInterfaceState.xcuserstate
===================================================================
(Binary files differ)




More information about the sword-cvs mailing list