API Reference

Core

ISN_AVAudioSession

namespace SA.IOSNative.AVFoundation
***
/// <summary>
/// An intermediary object that communicates to the system how you intend to use audio in your app.
/// 
/// An audio session acts as an intermediary between your app and the operating system—and, 
/// in turn, the underlying audio hardware. 
/// You use an audio session to communicate to the operating system the nature of your app’s audio without detailing the specific behavior 
/// or required interactions with the audio hardware. 
/// This behavior delegates the management of those details to the audio session, 
/// which ensures that the operating system can best manage the user’s audio experience.
/// </summary>
public static class ISN_AVAudioSession 
{

    //--------------------------------------
    // Public Methods
    //--------------------------------------
   

    /// <summary>
    /// Sets the current audio session category.
    /// 
    /// The audio session's category defines how the app intends to use audio. 
    /// Typically, you set the category before activating the session. 
    /// You can also set the category while the session is active, but this results in an immediate route change.
    /// </summary>
    /// <returns>Returns operation result info</returns>
    /// <param name="category">The audio session category to apply to the audio session.</param>
    public static SA_Result SetCategory(ISN_AVAudioSessionCategory category);

    /// <summary>
    /// Activates or deactivates your app’s audio session.
    /// 
    /// If another active audio session has higher priority than yours (for example, a phone call), 
    /// and neither audio session allows mixing, attempting to activate your audio session fails. 
    /// Deactivating your session will fail if any associated audio objects (such as queues, converters, players, or recorders) are currently running.
    /// </summary>
    /// <returns>Returns operation result info<</returns>
    /// <param name="isActive">Use <c>true</c> to activate your app’s audio session, or <c>false</c> to deactivate it.</param>
    public static SA_Result SetActive(bool isActive);

    //--------------------------------------
    // Get / Set
    //--------------------------------------

    /// <summary>
    /// The current audio session category.
    /// An audio session category defines a set of audio behaviors for your app.
    /// The default category assigned to an audio session is <see cref="ISN_AVAudioSessionCategory.SoloAmbient"/>.
    /// </summary>
    public static ISN_AVAudioSessionCategory Category {get;}

    /// <summary>
    /// The event is posted when the system’s audio route changes.
    /// </summary>
    /// <value>The on audio session route change.</value>
    public static SA_iEvent<ISN_AVAudioSessionRouteChangeReason> OnAudioSessionRouteChange {get;}
}

ISN_AVCaptureDevice

namespace SA.IOSNative.AVFoundation
***
/// <summary>
/// A device that provides input (such as audio or video) 
/// for capture sessions and offers controls for hardware-specific capture features.
/// </summary>
public class ISN_AVCaptureDevice
{
    /// <summary>
    /// Returns a constant indicating whether the app has permission for recording a specified media type
    /// 
    /// After the user grants recording permission, the system remembers the choice for future use in the same app, 
    /// but the user can change this choice at any time using the Settings app. 
    /// If the user has denied your app recoding permission or has not yet responded to the permission prompt, 
    /// any audio recordings will contain only silence and any video recordings will contain only black frames.
    /// </summary>
    /// <param name="type">A media type constant, either Video or Audio.</param>
    public static ISN_AVAuthorizationStatus GetAuthorizationStatus(ISN_AVMediaType type);

    /// <summary>
    /// Requests the user’s permission, if needed, for recording a specified media type.
    /// 
    /// Recording audio or video always requires explicit permission from the user.
    /// Your app must provide an explanation for its use of capture devices using the 
    /// <c>NSCameraUsageDescription</c> or <c>NSMicrophoneUsageDescription</c> Info.plist key; 
    /// iOS displays this explanation when initially asking the user for permission, 
    /// and thereafter in the Settings app. 
    /// Calling this method or attempting to start a capture session without a usage description raises an exception.
    /// </summary>
    /// <param name="type">media type.</param>
    /// <param name="callback">Callback.</param>
    public static void RequestAccess(ISN_AVMediaType type, Action<ISN_AVAuthorizationStatus> callback);
}

Controllers

ISN_NSBundle

namespace SA.IOSNative.Foundation
***
public class ISN_NSBundle
{
    /// <summary>
    /// Gets a value indicating whether this application is running in AppStore environment.
    /// </summary>
    public static bool IsRunningInAppStoreEnvironment {get;}

    /// <summary>
    /// Gets the information about current build 
    /// </summary>
    public static ISN_NSBuildInfo BuildInfo {get;}
}

ISN_NSUbiquitousKeyValueStore

namespace SA.IOSNative.Foundation
***
/// <summary>
/// An iCloud-based container of key-value pairs you use to share data among instances of your app running on a user's connected devices.
/// Use the iCloud key-value store to make preference, configuration, and app-state data available to every instance of your app on
/// every device connected to a user’s iCloud account. You can store scalar values such as BOOL, as well as values containing 
/// any of the property list object types: NSNumber, NSString, NSDate, NSData, NSArray, and NSDictionary.
/// </summary>
public static class ISN_NSUbiquitousKeyValueStore
{
    /// <summary>
    /// Sets a string object for the specified key in the key-value store.
    /// </summary>
    public static void SetString(string key, string value);

    /// <summary>
    /// Sets a int object for the specified key in the key-value store.
    /// </summary>
    public static void SetInt(string key, int value);

    /// <summary>
    /// Sets a bool object for the specified key in the key-value store.
    /// </summary>
    public static void SetBool(string key, bool value);

    /// <summary>
    /// Sets a float object for the specified key in the key-value store.
    /// </summary>
    public static void SetFloat(string key, float value);

    /// <summary>
    /// Sets a long object for the specified key in the key-value store.
    /// </summary>
    public static void SetLong(string key, long value);

    /// <summary>
    /// Sets a ulong object for the specified key in the key-value store.
    /// </summary>
    public static void SetULong(string key, ulong value);

    /// <summary>
    /// Sets a bytes array for the specified key in the key-value store.
    /// </summary>
    public static void SetBytes(string key, byte[] value);

    /// <summary>
    /// Sets a DateTime object for the specified key in the key-value store.
    /// </summary>
    public static void SetDateTime(string key, DateTime value);

    /// <summary>
    /// Sets an object for the specified key in the key-value store.
    /// </summary>
    public static void SetObject(string key, object obj);

    /// <summary>
    /// Explicitly synchronizes in-memory keys and values with those stored on disk.
    /// YES if the in-memory and on-disk keys and values were synchronized, or NO if an error occurred. 
    /// For example, this method returns NO if an app was not built with the proper entitlement requests.
    /// </summary>
    public static bool Synchronize();

    /// <summary>
    /// The object associated with the specified key or string value "null" if the key was not found.
    /// </summary>
    public static ISN_NSKeyValueObject KeyValueStoreObjectForKey(string key);

    /// <summary>
    /// Posted when the value of one or more keys in the local key-value store changed due to incoming data pushed from iCloud. 
    /// This notification is sent only upon a change received from iCloud; it is not sent when your app sets a value.
    /// </summary>
    public static SA_Event<ISN_NSStoreDidChangeExternallyNotification> StoreDidChangeExternallyNotification {get;}
}

Enums

ISN_NSUbiquitousKeyValueStoreChangeReasons

namespace SA.IOSNative.Foundation
***
public enum ISN_NSUbiquitousKeyValueStoreChangeReasons
{
    ServerChange,
    InitialSyncChange,
    QuotaViolationChange,
    AccountChange,
    None = -1
}

ISN_AVAudioSessionCategory

namespace SA.IOSNative.AVFoundation
***
public enum ISN_AVAudioSessionCategory
{
    //The category for an app in which sound playback is nonprimary—that is, your app can be used successfully with the sound turned off.
    Ambient,
    //The default audio session category.
    SoloAmbient,
    //The category for playing recorded music or other sounds that are central to the successful use of your app.
    Playback,
    //The category for recording audio; this category silences playback audio.
    Record,
    //The category for recording (input) and playback (output) of audio, such as for a VoIP (Voice over Internet Protocol) app.
    PlayAndRecord,
    //The category for routing distinct streams of audio data to different output devices at the same time.
    MultiRoute
}

ISN_AVAudioSessionRouteChangeReason

namespace SA.IOSNative.AVFoundation
***
/// <summary>
/// Constants values indicating the reason for an audio route change.
/// </summary>
public enum ISN_AVAudioSessionRouteChangeReason
{
    Unknown = 0,
    NewDeviceAvailable = 1,
    OldDeviceUnavailable = 2,
    CategoryChange = 3,
    Override = 4,
    WakeFromSleep = 6,
    NoSuitableRouteForCategory = 7,
    RouteConfigurationChange = 8
}

ISN_AVAuthorizationStatus

namespace SA.IOSNative.AVFoundation
***
/// <summary>
/// Constants that provide information regarding permission to use media capture devices.
/// </summary>
public enum ISN_AVAuthorizationStatus
{
    NotDetermined = 0,
    Restricted    = 1,
    Denied        = 2,
    Authorized    = 3
}

ISN_AVMediaType

namespace SA.IOSNative.AVFoundation
***
/// <summary>
/// An identifier for various media types.
/// </summary>
public enum ISN_AVMediaType
{
    Video = 0,
    Audio = 1
}

Templates

ISN_NSBuildInfo

namespace SA.IOSNative.Foundation
***
/// <summary>
/// Contains current build information
/// </summary>
[Serializable]
public class ISN_NSBuildInfo
{
    /// <summary>
    /// Current App Version
    /// </summary>
    public string AppVersion {get;}

    /// <summary>
    /// Current Build Number
    /// </summary>
    public string BuildNumber {get;}
}

ISN_NSDateComponents

namespace SA.IOSNative.Foundation
***
/// <summary>
/// An object that specifies a date or time in terms of units (such as year, month, day, hour, and minute) 
/// to be evaluated in a calendar system and time zone.
/// </summary>
public class ISN_NSDateComponents 
{
    //--------------------------------------
    // Accessing Hours and Seconds
    //--------------------------------------

    /// <summary>
    /// The number of hour units for the receiver.
    /// </summary>
    public long Hour;

    /// <summary>
    /// The number of minute units for the receiver.
    /// </summary>
    public long Minute;

    /// <summary>
    /// The number of second units for the receiver.
    /// </summary>
    public long Second;

    /// <summary>
    /// The number of nanosecond units for the receiver.
    /// </summary>
    public long Nanosecond;

    //--------------------------------------
    // Accessing Years and Months
    //--------------------------------------

    /// <summary>
    /// The number of years.
    /// </summary>
    public long Year;

    /// <summary>
    /// The number of months.
    /// </summary>
    public long Month;

    /// <summary>
    /// The number of days.
    /// </summary>
    public long Day;
}

ISN_NSKeyValueObject

namespace SA.IOSNative.Foundation
***
public class ISN_NSKeyValueObject
{
    /// <summary>
    /// Gets or sets the key of the Pair.
    /// </summary>
    public string Key {get;}

    /// <summary>
    /// Returns string representation of the value.
    /// </summary>
    public string StringValue {get;}

    /// <summary>
    /// Returns int representation of the value.
    /// </summary>
    public int IntValue {get;}

    /// <summary>
    /// Returns bool representation of the value.
    /// </summary>
    public bool BoolValue {get;}

    /// <summary>
    /// Returns float representation of the value.
    /// </summary>
    public float FloatValue {get;}

    /// <summary>
    /// Returns long representation of the value.
    /// </summary>
    public long LongValue {get;}

    /// <summary>
    /// Returns ulong representation of the value.
    /// </summary>
    public ulong ULongValue {get;}

    /// <summary>
    /// Returns Bytes array representation of the value.
    /// </summary>
    public byte[] BytesArrayValue {get;}

    /// <summary>
    /// Returns DateTime representation of the value.
    /// </summary>
    public DateTime DateTimeValue {get;}

    /// <summary>
    /// Create an object from its JSON representation. Internally, this method uses the Unity serializer; 
    /// therefore the type you are creating must be supported by the serializer.
    /// It must be a plain class/struct marked with the Serializable attribute.Fields of the object must have types supported by the serializer. 
    /// Fields that have unsupported types, as well as private fields or fields marked with the NonSerialized attribute, will be ignored.
    /// </summary>
    public T GetObject<T>();
}

ISN_NSKeyValueResult

namespace SA.IOSNative.Foundation
***
public class ISN_NSKeyValueResult : SA_Result
{
    public ISN_NSKeyValueResult(ISN_NSKeyValueObject keyValueObject);

    public ISN_NSKeyValueResult(SA_Error error) : base(error) {}

    /// <summary>
    /// Returns the object associated with the specified key.
    /// </summary>
    public ISN_NSKeyValueObject KeyValueObject {get;}
}

ISN_NSStoreDidChangeExternallyNotification

namespace SA.IOSNative.Foundation
***
public class ISN_NSStoreDidChangeExternallyNotification
{
    /// <summary>
    /// Return possible values associated with the NSUbiquitousKeyValueStoreChangeReasonKey key.
    /// </summary>
    public ISN_NSUbiquitousKeyValueStoreChangeReasons Reason {get;set;}

    /// <summary>
    /// Returns an array of ISN_NSKeyValueObject objects, that changed in the key-value store.
    /// </summary>
    public List<ISN_NSKeyValueObject> UpdatedData {get;set;}
}