浏览代码

add missing location streaming core methods to wrapper

cyberta 5 年之前
父节点
当前提交
b05e873899
共有 2 个文件被更改,包括 21 次插入0 次删除
  1. 12 0
      deltachat-ios/DC/Wrapper.swift
  2. 9 0
      deltachat-ios/Helper/LocationManager.swift

+ 12 - 0
deltachat-ios/DC/Wrapper.swift

@@ -221,6 +221,18 @@ class DcContext {
     func imex(what: Int32, directory: String) {
         dc_imex(contextPointer, what, directory, nil)
     }
+
+    func isSendingLocationsToChat(chatId: Int) -> Bool {
+        return dc_is_sending_locations_to_chat(contextPointer, UInt32(chatId)) == 1
+    }
+
+    func sendLocationsToChat(chatId: Int, seconds: Int) {
+        dc_send_locations_to_chat(contextPointer, UInt32(chatId), Int32(seconds))
+    }
+
+    func setLocation(latitude: Double, longitude: Double, accuracy: Double) {
+        dc_set_location(contextPointer, latitude, longitude, accuracy)
+    }
 }
 
 class DcConfig {

+ 9 - 0
deltachat-ios/Helper/LocationManager.swift

@@ -0,0 +1,9 @@
+//
+//  LocationManager.swift
+//  deltachat-ios
+//
+//  Created by Macci on 09.03.20.
+//  Copyright © 2020 Jonas Reinsch. All rights reserved.
+//
+
+import Foundation