API Reference

AV Foundation

ISN_AVAudioSession

namespace SA.iOS.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_AVPlayer

namespace SA.IOSNative.AVFoundation
...
/// <summary>
/// An object that provides the interface to control the player’s transport behavior.
/// </summary>
[Serializable]
public class ISN_AVPlayer 
{
    /// <summary>
    /// Initializes a new player to play a single audiovisual resource referenced by a given URL.
    /// </summary>
    /// <param name="url">A URL that identifies an audiovisual resource.</param>
    public ISN_AVPlayer(ISN_NSURL url);


    /// <summary>
    /// The audio playback volume for the player, ranging from 0.0 through 1.0 on a linear scale.
    /// 
    /// A value of 0.0 indicates silence; a value of 1.0 (the default) 
    /// indicates full audio volume for the player instance.
    /// 
    /// This property is used to control the player audio volume relative to the system volume. 
    /// There is no programmatic way to control the system volume in iOS, 
    /// but you can use the MediaPlayer framework’s MPVolumeView class 
    /// to present a standard user interface for controlling system volume.
    /// MPVolumeView is not yet implemented with the IOS Native plugin
    /// </summary>
    public float Volume {get; set;}

    /// <summary>
    /// A URL that identifies an audiovisual resource.
    /// </summary>
    public ISN_NSURL Url {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);
}

Foundation

ISN_NSURL

namespace SA.IOSNative.Foundation
...
/// <summary>
/// You can use URL objects to construct URLs and access their parts. 
/// For URLs that represent local files, you can also manipulate properties of those files directly, 
/// such as changing the file’s last modification date. 
/// Finally, you can pass URL objects to other APIs to retrieve the contents of those URLs.
/// </summary>
[Serializable]
public class ISN_NSURL
{
    /// <summary>
    /// The initial url string it was created with
    /// All initial url string adjustmens will take place inside the native plugin part
    /// </summary>
    /// <value>The URL.</value>
    public string Url {get;} 

    /// <summary>
    /// The url type.
    /// Url will be transaformed on native plugin side depending of url type
    /// </summary>
    /// <value>The type.</value>
    private URLType Type {get;} 

    /// <summary>
    /// Creates and returns an NSURL object initialized with a provided URL string.
    /// </summary>
    /// <param name="url">
    /// The URL string with which to initialize the NSURL object. 
    /// Must be a URL that conforms to RFC 2396. 
    /// This method parses URLString according to RFCs 1738 and 1808..
    /// </param>
    public static ISN_NSURL URLWithString(string url);

    /// <summary>
    /// Initializes and returns a newly created <see cref="ISN_NSURL"/> object as a file URL with a specified path.
    /// </summary>
    /// <param name="path">The path that the <see cref="ISN_NSURL"/> object will represent. 
    /// path should be a valid system path, and must not be an empty path.
    /// </param>
    public static ISN_NSURL FileURLWithPath(string path);

    /// <summary>
    /// Initializes and returns a newly created <see cref="ISN_NSURL"/> object as a file URL with a specified path 
    /// relative to the unity StreamingAssets folder.
    /// </summary>
    /// <param name="path">The path that the <see cref="ISN_NSURL"/> object will represent. 
    /// path should be a valid StreamingAssets folder relative path, and must not be an empty path.
    /// </param>
    public static ISN_NSURL StreamingAssetsURLWithPath(string path);

}

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;}
}

ISN_NSLocale

namespace SA.IOSNative.Foundation
...
/// <summary>
/// Information about linguistic, cultural, and technological conventions 
/// for use in formatting data for presentation.
/// </summary>
public class ISN_NSLocale 
{
    /// <summary>
    /// The identifier for the locale.
    /// </summary>
    public string Identifier  {get;}


    /// <summary>
    /// The country code for the locale.
    /// Examples of country codes include "GB", "FR", and "HK".
    /// </summary>
    public string CountryCode  {get;}

    /// <summary>
    /// The language code for the locale.
    /// Examples of language codes include "en", "es", and "zh".
    /// </summary>
    public string LanguageCode  {get;}

    /// <summary>
    /// The currency symbol for the locale.
    /// Example currency symbols include "$", "€", and "¥".
    /// </summary>
    public string CurrencySymbol  {get;}


    /// <summary>
    /// The currency code for the locale.
    /// Example currency codes include "USD", "EUR", and "JPY".
    /// </summary>
    public string CurrencyCode  {get;}
}

ISN_NSTimeZone


namespace SA.IOSNative.Foundation
...
/// <summary>
/// Information about standard time conventions associated with a specific geopolitical region.
/// 
/// Time zones represent the standard time policies for a geopolitical region. 
/// Time zones have identifiers like “America/Los_Angeles” and can also be identified by abbreviations, 
/// such as PST for Pacific Standard Time.
/// </summary>
[Serializable]
public class ISN_NSTimeZone
{
    //--------------------------------------
    // Get / Set
    //--------------------------------------


    /// <summary>
    /// The geopolitical region ID that identifies the receiver.
    /// </summary>
    public string Name {get;}


    /// <summary>
    /// A textual description of the time zone including the name, abbreviation, 
    /// offset from GMT, and whether or not daylight saving time is currently in effect.
    /// </summary>
    public string Description {get;}


    /// <summary>
    /// The current difference in seconds between the receiver and Greenwich Mean Time.
    /// </summary>
    public int SecondsFromGMT {get;}


    //--------------------------------------
    // Static Methods
    //--------------------------------------


    /// <summary>
    /// Clears any time zone value cached for the systemTimeZone property.
    /// 
    /// If the app has cached the system time zone by accessing the <see cref="SystemTimeZone"/> class property, 
    /// this method clears that cached value. 
    /// If you subsequently access the  <see cref="SystemTimeZone"/> class property, 
    /// a new time zone object is created and cached.
    /// </summary>
    public static void ResetSystemTimeZone();


    /// <summary>
    /// Gets the local time zone.
    /// 
    /// If the current system time zone cannot be determined, the GMT time zone is used instead.
    ///
    /// If you access the  <see cref="SystemTimeZone"/> class property, 
    /// its value is cached by the app and doesn't update if the user subsequently changes the system time zone. 
    /// In order for the systemTimeZone property to reflect the new time zone, 
    /// you must first call the <see cref="ResetSystemTimeZone()"/> method to clear the cached value. 
    /// Then, the next time you access the <see cref="SystemTimeZone"/> property, 
    /// it returns the current system time zone, and caches that value.
    /// 
    /// If you access the  <see cref="SystemTimeZone"/>  class property, assign its value to a variable, 
    /// and clear the cached value for the property by calling the <see cref="ResetSystemTimeZone()"/> method, 
    /// the object stored in the variable doesn't update to reflect the new system time zone. 
    /// Contrast this behavior with that of the <see cref="LocalTimeZone"/> class property, 
    /// which returns a proxy object that always reflects the current system time zone.
    /// </summary>
    public static ISN_NSTimeZone LocalTimeZone {get;}



    /// <summary>
    /// Gets the local time zone.
    /// 
    /// If the current system time zone cannot be determined, the GMT time zone is used instead.
    ///
    /// If you access the  <see cref="SystemTimeZone"/> class property, 
    /// its value is cached by the app and doesn't update if the user subsequently changes the system time zone. 
    /// In order for the systemTimeZone property to reflect the new time zone, 
    /// you must first call the <see cref="ResetSystemTimeZone()"/> method to clear the cached value. 
    /// Then, the next time you access the <see cref="SystemTimeZone"/> property, 
    /// it returns the current system time zone, and caches that value.
    /// 
    /// If you access the  <see cref="SystemTimeZone"/>  class property, assign its value to a variable, 
    /// and clear the cached value for the property by calling the <see cref="ResetSystemTimeZone()"/> method, 
    /// the object stored in the variable doesn't update to reflect the new system time zone. 
    /// Contrast this behavior with that of the <see cref="LocalTimeZone"/> class property, 
    /// which returns a proxy object that always reflects the current system time zone.
    /// </summary>
    public static ISN_NSTimeZone SystemTimeZone {get;}


    /// <summary>
    /// The default time zone for the current app.
    /// 
    /// If no <see cref="DefaultTimeZone"/> time zone has been set, the current system time zone is used. 
    /// If the current system time zone cannot be determined, the GMT time zone is used instead.
    /// 
    /// The <see cref="DefaultTimeZone"/> time zone is used by the app for date and time operations.
    /// You can set it to cause the app to run as if it were in a different time zone. 
    /// Setting the <see cref="DefaultTimeZone"/> property clears any value that was previously set.
    /// 
    /// If you access the <see cref="DefaultTimeZone"/> class property, 
    /// assign its value to a variable, and set a new defaultTimeZone time zone, 
    /// the object stored in the variable doesn't update to reflect the new defaultTimeZone time zone. 
    /// Contrast this behavior with that of the localTimeZone class property, 
    /// which returns a proxy object that always reflects the current system time zone.
    /// </summary>
    public static ISN_NSTimeZone DefaultTimeZone {get;}

}