Table of Contents
- 유니티에 API가 없어 직접 native와 연결
- 유구한 역사와 전통의 make build로 구성
- C# (Unity) <-> C FFI <-> Swift (iOS)
- HealthKit -> Health Data
- HealthKit + CoreMotion + CoreML -> Sleep Detection
make build
make push
TestProject/Assets/Scripts/NativePluginTest.cs
확인
using NativePlugin.HealthData;
bool HealthData.IsAvailable()
void HealthData.RequestAuth()
void HealthData.QuerySleepSamples(DateTime startDate, DateTime endDate, int maxNumSamples)
void HealthData.QueryActivitySamples(DateTime startDate, DateTime endDate)
event RequestAuthCompletedHandler HealthData.RequestAuthCompleted
event QuerySleepSamplesCompletedHandler HealthData.QuerySleepSamplesCompleted
event QueryActivitySamplesCompletedHandler HealthData.QueryActivitySamplesCompleted
delegate void RequestAuthCompletedHandler(bool granted)
delegate void QuerySleepSamplesCompletedHandler(
SleepSample
[] samples)
delegate void QueryActivitySamplesCompletedHandler(
ActivitySample
[] samples)
using NativePlugin.SleepDetection;
bool SleepDetection.IsAvailable()
SleepDetectionResult
SleepDetection.DetectSleep()
Distributed under the MIT License. See LICENSE.txt
for more information.