# UnityiOSBridgeEssentials
**Repository Path**: youngfun2yf/UnityiOSBridgeEssentials
## Basic Information
- **Project Name**: UnityiOSBridgeEssentials
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-05-03
- **Last Updated**: 2021-05-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# UnityiOSBridgeEssentials
Unity3d iOS Plugin / iOS Bridge for communicating with iOS Native Code from Unity
Example of how to use the iOSPlugin:
### Basic Alert
```csharp
iOSPlugin.ShowAlert("Hello", "World");
```
### Alert With Confirmation and callback to Unity
```csharp
iOSPlugin.ShowAlertConfirmation("Basic Alert Confirmation", "Hello this is a basic confirmation !", "CallBack");
```
### Sharing a Message and Url
```csharp
iOSPlugin.ShareMessage("Welcome To iOS Bridge Essentials", "https://www.github.com/dilmerv/UnityiOSBridgeEssentials");
```
### Get Battery Status
```csharp
iOSPlugin.GetBatteryStatus()
// possible statuses are return in the BatterStatus enum
public enum BatteryStatus
{
UIDeviceBatteryStateUnknown = 0,
UIDeviceBatteryStateUnplugged = 1,
UIDeviceBatteryStateCharging = 2,
UIDeviceBatteryStateFull = 3
}
```
### Get Battery Level
```csharp
iOSPlugin.GetBatteryLevel()
```
### Save String Value to iCloud
```csharp
bool success = iOSPlugin.iCloudSaveStringValue(ICLOUD_KEY, valueToSave);
```
### Get String Value from iCloud
```csharp
string savedValue = iOSPlugin.iCloudGetStringValue(ICLOUD_KEY);
```
### iCloud Entitlement Requirement
Be sure to include the entitlement below otherwise icloud key value store will not work
```xml
com.apple.developer.icloud-container-identifiers
com.apple.developer.ubiquity-kvstore-identifier
$(TeamIdentifierPrefix)$(CFBundleIdentifier)
```
### Save Integer Value to iCloud
```csharp
bool success = iOSPlugin.iCloudSaveIntValue(ICLOUD_KEY, valueToSave);
```
### Get Integer Value from iCloud
```csharp
int savedValue = iOSPlugin.iCloudGetIntValue(ICLOUD_KEY);
```
### Save Bool Value to iCloud
```csharp
bool success = iOSPlugin.iCloudSaveBoolValue(ICLOUD_KEY, valueToSave);
```
### Get Bool Value from iCloud
```csharp
bool savedValue = iOSPlugin.iCloudGetBoolValue(ICLOUD_KEY);
```
