Git Product home page Git Product logo

ttlock / ios_sdk_demo Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 10.0 139.48 MB

TTLock is a global provider of solutions for smart locks. We provide PCBA and softwares for lock manufactures and end users. We provide open API/SDK for developers. With these APIs/SDKs, you can develop your own applications to manage smart locks. The SDK here is for mobile app to communicate with locks via bluetooth.

License: MIT License

Ruby 0.42% Objective-C 99.58%
bluetooth-lock smart-lock smart-lock-solution ttlock ttlock-sdk

ios_sdk_demo's People

Contributors

juannyios avatar ttlock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ios_sdk_demo's Issues

'Frameworks/TTLock.framework/TTLock' does not contain bitcode

Hello,

when i upload the watchOS app that contains the TTLock framework to the appstore it gives me this error:
ITMS-90496: Invalid Executable - The executable '/Watch/mm.app/PlugIns/mm Extension.appex/Frameworks/TTLock.framework/TTLock' does not contain bitcode.

ITMS-90496: Invalid Executable - The executable 'mm.app/Watch/mm.app/PlugIns/mm Extension.appex/mm Extension' does not contain bitcode.

touch to unlock

Hello,

how to unable touch to unlock as same in TTlock app.

Get all logs from TTLock SDK.

TTLock.getOperationLog(with: .all, lockData: lockdata) { value in
                        
                    } failure: { errorCode, errorMsg in
                        
                    }

When I call the above method with .all, it returns too many records. I just want to confirm, does the method have a limit on the number of records it returns for a specified duration, such as 6 months or 1 year?

Implementation for Privacy lock and tamper alert feature

Hi ,

I am currently using TTLock SDK wherein I need to implement privacy lock and tamper alert feature . The implementation include setting and getting the corresponding values of these features from the lock.

Please guide .
Thanks

WatchOS support

Hello,

You have TTlock app for watchOS, but trying to install the library through pods for watchOS app show that watchOS is not supported by TTLock framework?

Lock Handing direction not updated in the original TTLock app.

We have implemented setting directions(left and right) functionality in our app. We are calling below TTlock API from our server to set lock handing direction. We are getting success response but handing direction not updated in the original TTLock app.

curl --location 'https://euapi.ttlock.com/v3/lock/updateSetting'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'clientId= 4773aa036f7f49c68d876bb4be85c80c'
--data-urlencode 'accessToken= dfd5489d0cee31f0bdfaf59d0d42d71f'
--data-urlencode 'lockId= 163377'
--data-urlencode 'type=7'
--data-urlencode 'date=1700891985547'

We are also calling below SDK method to update the same.

TTLock.setUnlockDirection(TTUnlockDirection.left, lockData: lockData) {
print(success)
} failure: { error, message in
print(error)
print(message ?? "")
}

When we change handing direction from original TTLock app itself then its updated successfully.

Are we missing something here? Please correct if any.

How to use this sdk delegate in swift?

I am having some difficulty implementing the delegate methods in Swift.

  • How to declare the TTLock delegate protocol in Swift?
  • How to properly implement the delegate methods in Swift?
  • Any examples or code snippets would be greatly appreciated.

IOS NSRangeException

ttlock_flutter: ^0.3.0

Flutter 3.13.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ead455963c (4 weeks ago) • 2023-09-26 18:28:17 -0700
Engine • revision a794cf2681
Tools • Dart 3.1.3 • DevTools 2.25.0

MacOS Sonoma 14.0
XCode 15.0

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndexedSubscript:]: index 39 beyond bounds [0 .. 38]'
*** First throw call stack:
(0x19fbf9e88 0x198f2f8d8 0x19fd9f0a8 0x19fc09dec 0x100dba5e0 0x100db94ac 0x100db9054 0x100db3dc0 0x100d5a9c4 0x100da3c40 0x1bfbf0958 0x1bfbecc80 0x1bfbec7b8 0x1bfbec690 0x1a71c84b4 0x1a71c9fdc 0x1a71d1694 0x1a71d2214 0x1a71d8748 0x1a71d8444 0x19fc8a6f8 0x19fc6c058 0x19fc70ed4 0x1d8f72368 0x1a214f3d0 0x1a214f034 0x100d50624 0x1be2d8960)
libc++abi: terminating with uncaught exception of type NSException

  • thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001dc7f8200 libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib:
    -> 0x1dc7f8200 <+8>: b.lo 0x1dc7f8220 ; <+40>
    0x1dc7f8204 <+12>: pacibsp
    0x1dc7f8208 <+16>: stp x29, x30, [sp, #-0x10]!
    0x1dc7f820c <+20>: mov x29, sp
    Target 0: (Runner) stopped.
    Lost connection to device.

Upload data functionality in TTlock App.

Skype_Picture_2024_01_09T13_37_02_108Z

Upload data functionality: We want to achieve the same functionality as in TTlock App. I have attached here screenshot for the same.

Could you please provide the details for the relevent SDK method / API to achieve the same functionality in our app?

watchOS support

Hi,
it's great library and it's working fine. I am thinking about creating watchOS app too and I would like to be almost independet app. Are you planning to get library building and working in watchOS? At least for locking or unlocking.
Thanks for info

XCFramework Support

Do you have plans to make available a version of TTLock Frameworks as XCFrameworks to avoid compilation problems on M1 Macs and Xcode 12+?

I'm currently facing some issues as you can see above.

image

Additionally, I'm interested to use SDK at watchOS but I cannot find any information about them. Do they exist?

E-mail: [email protected]

Request for Privacy Changes Updates in SDK and Required Signed XCFramework.

  1. We are using the TTLock third-party SDK in our iOS project. Could you please confirm whether you are planning to adopt the privacy changes mentioned in the article "Privacy changes for app developers"? This is important because failure to comply could result in Apple rejecting our app. Please find the below reference links.

https://developer.apple.com/documentation/bundleresources/privacy_manifest_files

https://www.adjust.com/blog/privacy-changes-for-app-developers-ios-17/

  1. Additionally, we require a signed XCFramework for the TTLock. As we are using it as Swift package.

https://developer.apple.com/documentation/xcode/verifying-the-origin-of-your-xcframeworks

TTGateway initialization fails

Hello,
When I call TTGateway initializeGatewayWithInfoDic after I have connected the Gateway nothing happens for like 2 minutes after which the block is called with TTGatewayStatus = TTGatewayDisconnect. There are no other error messages. Why is this happening?

CoreBluetooth is not correctly initialized

Hello.

We're trying to integrate your framework into our Swift project. We've followed your documentation, but still haven't found a fix for a problem we're having.

The initialization of the bluetooth fails. It logs

TTLockLog#####scan,CoreBluetooth is not correctly initialized !#####

And the TTLock scan doesn't work at all. We're able to communicate with the lock having the lockData, but we're unable to scan it.

The app asks for bluetooth permission and we've accepted the prompt at the device, but this error still appears.

Any advice on how to make the TTLock bluetooth work? I've set up a demo project to show you what we're trying to do so you can see the error first hand.

Thanks in advance.

xcode 15 ld: 32 duplicate symbols

can't launch project with ttlock on xcode 15. pls. fix

duplicate symbol 'OBJC_CLASS$_HFSmartLinkDeviceInfo' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]15
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]11
duplicate symbol 'OBJC_IVAR$_HFSmartLink.withV3x' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_Udpproxy.recvmsg' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink.cont' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_METACLASS$_Udpproxy' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink._isConfigOneDevice' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLinkDeviceInfo._ip' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]15
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]11
duplicate symbol 'OBJC_METACLASS$_HFSmartLinkDeviceInfo' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]15
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]11
duplicate symbol 'OBJC_IVAR$_Udpproxy.localAdd' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink.udp' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.pswd' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.stopBlock' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_Udpproxy.remoteAdd' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink.endBlock' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_Udpproxy.sockfd' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_Udpproxy.num' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink.deviceDic' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.processBlock' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink._waitTimers' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.isconnnecting' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_Udpproxy.sockMCast' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_Udpproxy.sendmsg' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLinkDeviceInfo._mac' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]15
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]11
duplicate symbol 'OBJC_CLASS$_HFSmartLink' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.failBlock' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.cont_len' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_HFSmartLink.successBlock' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_METACLASS$_HFSmartLink' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_IVAR$_Udpproxy.findAdd' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink.userStoping' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
duplicate symbol 'OBJC_CLASS$_Udpproxy' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]14
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]10
duplicate symbol 'OBJC_IVAR$_HFSmartLink.sendTime' in:
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]12
-/Pods/TTLockGateway/TTLockFrameworks/TTLockGateway.framework/TTLockGateway[arm64]8
ld: 32 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)

identityCard/changePeriod api request gives 400 bad request

API Name: https://api.ttlock.com.cn/v3
Method: POST
URL: https://api.ttlock.com.cn/v3/identityCard/changePeriod
Params:
{
accessToken = mytoken;
cardId = 56331608;
changeType = 1;
clientId = myclientid;
date = 1707667792342;
endDate = 0;
startDate = 0;
}
HTTP Header:
{
"Accept-Language" = "en-UZ;q=1, ru-UZ;q=0.9";
"Content-Type" = "application/x-www-form-urlencoded";
"User-Agent" = "iOS_SDK_Demo/3.3.1 (iPhone; iOS 17.1.2; Scale/3.00)";
}

API RESPONSE:

HTTP URL:
https://api.ttlock.com.cn/v3/identityCard/changePeriod
ResponseContent:
(null)

Error Domain: com.alamofire.error.serialization.response
Error Domain Code: -1011
Error Localized Description: Request failed: bad request (400)

and there is no difference if I set another date or set permanent date

Cannot get passage mode value

I am using TTLock.getPassageModes(withLockData: lockData) to get passage mode value for my lock , it works in majority cases but in some locks there is error obtaining the same . Usually resulting in the error with code 99 , below is a snippet of error received .

invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution. "TTLock Error : TTError(rawValue: 99)" "TTLock Error Msg : Optional(\"Bluetooth has disconnected, please try again\")"

Please advice.

Freeze lock issue

When i check the lock support lockfreeze function:

  • (BOOL)lockFeatureValue:(NSString *)lockData suportFunction:(TTLockFeatureValue)function;
    ==> It return true
    But when call:
    1/ + (void)setLockConfigWithType:(TTLockConfigType)type
    on:(BOOL)on
    lockData:(NSString *)lockData
    success:(TTSucceedBlock)success
    failure:(TTFailedBlock)failure;
    2/ + (void)getLockConfigWithType:(TTLockConfigType)type
    lockData:(NSString *)lockData
    success:(TTGetLockConfigSuccessBlock)success
    failure:(TTFailedBlock)failure;

==> return error "The lock does not support this function"
Please help

TTlock handle in Mirror issue

VID_20240116_124643.mp4

Please check this video. If we press 1 it got pressed 6, If we press 2 it got pressed 7. We have also tried after hard resetting a lock but issue is still persist.

Please provide solution.

In iOS , TTLock getOperationLog returns operation record with uid 0

I am currently trying to fetch operation log using your SDK , but when I uploaded to the log to server , the username came as null. On further inspection , I found that when operation record is fetched before uploading the corresponding uid is 0 . How can I solve this problem.

How to downgrade lock firmware version?

We are implementing upgrade lock firmware version functionality. We are using below SDK method from TTLockDFU library.

TTLockDFU.shareInstance().start(withClientId: clientId, accessToken: accessToken, lockId: lockId, lockData: lockData) { upgradeOperation, process in
print(upgradeOperation)
} fail: { upgradeOperation, upgradeErrorCode in
print(upgradeOperation)
print(upgradeErrorCode)
}

We have all the locks available with latest firmware version. We want to downgrade the firmware version of lock to test this feature.

Not seeing TTDoorSensor class

Hello,

I'm using the TTLock.framework in my Swift project in Xcode. In Headers, there is "@interface TTDoorSensor : NSObject", but when I try to use the 'TTDoorSensor' class in Swift, I get the error message "Cannot find 'TTDoorSensor' in scope". Could you provide some guidance on what I can do to resolve this issue?

Other classes like TTLock, TTWirelessKeypad and TTWirelessKeyFob I have no problem with and I am using it in code. I tried demo app here with ObjectiveC and it seems it has same issue. There must be something missing in header for framework.

Thanks for help,
Libor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.