This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIHandler.cs
52 lines (44 loc) · 1.52 KB
/
UIHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using UnityEngine;
public class UIHandler : MonoBehaviour
{
public void ShowBasicAlert()
{
iOSPlugin.ShowAlert("Basic Alert", "Hello this is a basic alert !");
}
public void ShowAlertConfirmation()
{
iOSPlugin.ShowAlertConfirmation("Basic Alert Confirmation", "Hello this is a basic confirmation !", "CallBack");
}
public void ShareMessage()
{
iOSPlugin.ShareMessage("Sharing a message!", "https://github.com/georgehuan1994/Unity-iOS-iCloud-Plugin");
}
public void BatteryStatus()
{
var batteryStatus = iOSPlugin.GetBatteryStatus();
iOSPlugin.ShowAlert("Battery Status", batteryStatus.ToString());
}
public void BatteryLevel()
{
string batteryLevel = iOSPlugin.GetBatteryLevel();
iOSPlugin.ShowAlert("Battery Level", batteryLevel);
}
public void iCloudGetStringValue()
{
string savedValue = iOSPlugin.iCloudGetStringValue("UIHandler.String.Key");
iOSPlugin.ShowAlert("iCloud Value", string.IsNullOrEmpty(savedValue) ? "Nothing Saved Yet..." : savedValue);
}
public void iCloudSaveStringValue()
{
string valueToSave = System.Guid.NewGuid().ToString();
bool success = iOSPlugin.iCloudSaveStringValue("UIHandler.String.Key", valueToSave);
if (success)
{
iOSPlugin.ShowAlert("iCloud Value Saved Success", valueToSave);
}
else
{
iOSPlugin.ShowAlert("iCloud Value Saved failed", valueToSave);
}
}
}