Ejemplo n.º 1
0
 /// <summary>
 /// Create new Reminder though EventKit.
 /// <summary>
 public void SaveReminder(Action <ISN_EventKitSaveResult> callback, ISN_EventKitDataRequest reminderData, ISN_AlarmDataRequest alarmData, ISN_RecurrenceRuleRequest recurrenceRule)
 {
     #if UNITY_IPHONE && EVENT_KIT_ENABLED
     string data  = JsonUtility.ToJson(reminderData);
     string alarm = null;
     string recurrenceRuleData = null;
     if (alarmData != null)
     {
         alarm = JsonUtility.ToJson(alarmData);
     }
     else
     {
         alarm = JsonUtility.ToJson(new ISN_AlarmDataRequest());
     }
     if (recurrenceRule != null)
     {
         recurrenceRuleData = JsonUtility.ToJson(recurrenceRule);
     }
     else
     {
         recurrenceRuleData = JsonUtility.ToJson(new ISN_RecurrenceRuleRequest());
     }
     _ISN_SaveReminder(ISN_MonoPCallback.ActionToIntPtr <ISN_EventKitSaveResult>(callback), data, alarm, recurrenceRuleData);
     #endif
 }
Ejemplo n.º 2
0
        public static void SetDelegate(ISN_iCLLocationManagerDelegate @delegate)
        {
#if API_ENABLED
            _ISN_CL_SetDelegate(
                ISN_MonoPCallback.ActionToIntPtr <int>(result =>
            {
                var auth = (ISN_CLAuthorizationStatus)result;
                @delegate.DidChangeAuthorizationStatus(auth);
            }),
                ISN_MonoPCallback.ActionToIntPtr <ISN_CLLocationArray>(result =>
            {
                @delegate.DidUpdateLocations(result);
            }),
                ISN_MonoPCallback.ActionToIntPtr <SA_Error>(result =>
            {
                @delegate.DidFailWithError(result);
            }),
                ISN_MonoPCallback.ActionToIntPtr <SA_Error>(result =>
            {
                @delegate.DidFinishDeferredUpdatesWithError(result);
            }),
                ISN_MonoPCallback.ActionToIntPtr <int>(result =>
            {
                @delegate.DidPauseLocationUpdates();
            }),
                ISN_MonoPCallback.ActionToIntPtr <int>(result =>
            {
                @delegate.DidResumeLocationUpdates();
            })
                );
#endif
        }
Ejemplo n.º 3
0
 public void ReportAchievements(List <ISN_GKAchievement> achievements, Action <SA_Result> callback)
 {
     #if API_ENABLED
     var request = new ISN_GKAchievementsResult(achievements);
     _ISN_GKAchievement_ReportAchievements(JsonUtility.ToJson(request), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create Wheel UIPickerView.
 /// It will create UIPickerView with cancel and done buttons.
 /// </summary>
 public void ShowUIWheelPicker(ISN_UIWheelPickerController controller, Action <ISN_UIWheelPickerResult> callback)
 {
     #if UNITY_IPHONE
     var data = JsonUtility.ToJson(controller);
     _ISN_UIWheelPicker(ISN_MonoPCallback.ActionToIntPtr(callback), data);
     #endif
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Set's a delegate that the authorization controller informs about the success or failure of an authorization attempt.
 /// </summary>
 /// <param name="delegate">A delegate that the authorization controller informs about the success or failure of an authorization attempt.</param>
 public void SetDelegate(ISN_IASAuthorizationControllerDelegate @delegate)
 {
     ISN_AuthenticationServicesLib._ISN_ASAuthorizationController_setDelegate(
         NativeHashCode,
         ISN_MonoPCallback.ActionToIntPtr <SA_Error>(@delegate.DidCompleteWithError),
         ISN_MonoPCallback.ActionToIntPtr <ISN_ASAuthorizationAppleIDCredential>(@delegate.DidCompleteWithAuthorization));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Allows user to pick a date using the native iOS calendar view.
 /// </summary>
 /// <param name="callback">Callback with picked date once user is finished.</param>
 /// <param name="startFromYear">Optional. Year the calendar will start from.</param>
 public static void PickDate(Action <DateTime> callback, int startFromYear = 0)
 {
                 #if UNITY_IPHONE
     _ISN_PickDate(startFromYear, ISN_MonoPCallback.ActionToIntPtr <string>((time) => {
         UnityEngine.Debug.Log("here date pick: " + time);
         DateTime dt = DateTime.Parse(time);
         callback.Invoke(dt);
     }));
                 #endif
 }
Ejemplo n.º 7
0
 public void AuthenticateLocalPlayer(Action <SA_Result> callback)
 {
     #if API_ENABLED
     _ISN_AuthenticateLocalPlayer(
         ISN_MonoPCallback.ActionToIntPtr(callback),
         ISN_MonoPCallback.ActionToIntPtr <ISN_GKSavedGameSaveResult>(m_DidModifySavedGame.Invoke),
         ISN_MonoPCallback.ActionToIntPtr <ISN_GKSavedGameFetchResult>(m_HasConflictingSavedGames.Invoke)
         );
     #endif
 }
Ejemplo n.º 8
0
        //--------------------------------------
        // Public Methods
        //--------------------------------------

        /// <summary>
        /// Adds an entry to the notification center's dispatch table that includes a notification queue
        /// and a block to add to the queue, and an optional notification name.
        /// </summary>
        /// <param name="name">
        /// The name of the notification for which to register the observer;
        /// that is, only notifications with this name are used to add the block to the operation queue.
        /// </param>
        /// <param name="callback">The block to be executed when the notification is received.</param>
        public void AddObserverForName(string name, Action <ISN_NSNotification> callback)
        {
            if (Application.isEditor)
            {
                return;
            }

#if UNITY_IPHONE || UNITY_TVOS
            _ISN_NSNotificationCenter_AddObserverForName(name, ISN_MonoPCallback.ActionToIntPtr(callback));
#endif
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Remove event though EventKit by it's identifier.
 /// <summary>
 public void RemoveEvent(Action <SA_Result> callback, string identifier)
 {
     if (string.IsNullOrEmpty(identifier))
     {
         SA_Error  error  = new SA_Error(1, "Identifier parameter is empty or null.");
         SA_Result result = new SA_Result(error);
         callback.Invoke(result);
     }
     #if UNITY_IPHONE && EVENT_KIT_ENABLED
     _ISN_RemoveEvent(ISN_MonoPCallback.ActionToIntPtr <SA_Result>(callback), identifier);
     #endif
 }
Ejemplo n.º 10
0
        public void Present(Action <ISN_UIActivityViewControllerResult> callback)
        {
            if (Application.isEditor)
            {
                var r = new ISN_UIActivityViewControllerResult();
                callback.Invoke(r);
                return;
            }

            #if (UNITY_IPHONE && SOCIAL_API_ENABLED)
            string data = JsonUtility.ToJson(this);
            _ISN_SOCIAL_PresentActivityViewController(data, ISN_MonoPCallback.ActionToIntPtr <ISN_UIActivityViewControllerResult>((result) => {
                callback.Invoke(result);
            }));
            #endif
        }
Ejemplo n.º 11
0
#pragma warning restore 414



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


        public void Show(Action <DateTime> callback)
        {
            if (Application.isEditor)
            {
                callback.Invoke(DateTime.Now);
                return;
            }



#if UNITY_IPHONE
            var json = JsonUtility.ToJson(this);
            _ISN_ShowDP(json, ISN_MonoPCallback.ActionToIntPtr <string>((time) => {
                DateTime dt = DateTime.Parse(time);
                callback.Invoke(dt);
            }));
#endif
        }
Ejemplo n.º 12
0
 public void GenerateIdentityVerificationSignatureWithCompletionHandler(Action <ISN_GKIdentityVerificationSignatureResult> callback)
 {
     #if API_ENABLED
     _ISN_GKLocalPlayer_GenerateIdentityVerificationSignatureWithCompletionHandler(ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 13
0
 public void GKPlayerLoadPhotoForSize(string playerId, int size, Action <ISN_GKImageLoadResult> callback)
 {
     #if ((UNITY_IPHONE || UNITY_TVOS) && GAME_KIT_API_ENABLED)
     _ISN_GKPlayer_LoadPhotoForSize(playerId, size, ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 14
0
 public void ReportScore(ISN_GKScoreRequest scoresRequest, Action <SA_Result> callback)
 {
     #if API_ENABLED
     _ISN_GKLeaderboard_ReportScore(JsonUtility.ToJson(scoresRequest), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 15
0
 public void LoadScores(ISN_GKLeaderboard leaderboard, Action <ISN_GKScoreLoadResult> callback)
 {
     #if API_ENABLED
     _ISN_GKLeaderboard_LoadScores(JsonUtility.ToJson(leaderboard), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 16
0
        //--------------------------------------
        // Leaderboards
        //--------------------------------------

        public void LoadLeaderboards(Action <ISN_GKLeaderboardsResult> callback)
        {
            #if API_ENABLED
            _ISN_GKLeaderboard_LoadLeaderboards(ISN_MonoPCallback.ActionToIntPtr(callback));
            #endif
        }
Ejemplo n.º 17
0
 public void GenerateIdentityVerificationSignatureWithCompletionHandler(Action <ISN_GKIdentityVerificationSignatureResult> callback)
 {
     #if ((UNITY_IPHONE || UNITY_TVOS) && GAME_KIT_API_ENABLED)
     _ISN_GKLocalPlayer_GenerateIdentityVerificationSignatureWithCompletionHandler(ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 18
0
 public void ResolveConflictingSavedGames(ISN_GKResolveSavedGamesRequest request, Action <ISN_GKSavedGameFetchResult> callback)
 {
     #if API_ENABLED
     _ISN_GKLocalPlayer_ResolveSavedGames(JsonUtility.ToJson(request), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 19
0
 public void RefreshRequest(ISN_SKReceiptDictionary dictionary, Action <SA_Result> callback)
 {
     #if ((UNITY_IPHONE || UNITY_TVOS) && STORE_KIT_API_ENABLED)
     _ISN_SK_RefreshRequest(JsonUtility.ToJson(dictionary), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 20
0
 public void SavedGame(string gameName, string data, Action <ISN_GKSavedGameSaveResult> callback)
 {
     #if API_ENABLED
     _ISN_GKLocalPlayer_SaveGameData(gameName, data, ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 21
0
 public void FetchSavedGames(Action <ISN_GKSavedGameFetchResult> callback)
 {
     #if API_ENABLED
     _ISN_GKLocalPlayer_FetchSavedGames(ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 22
0
 public void ShowGameKitView(ISN_GKGameCenterViewController view, Action <SA_Result> callback)
 {
     #if API_ENABLED
     _ISN_GKGameCenterViewControllerShow(JsonUtility.ToJson(view), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 23
0
 public void GKPlayerLoadPhotoForSize(string playerId, int size, Action <ISN_GKImageLoadResult> callback)
 {
     #if API_ENABLED
     _ISN_GKPlayer_LoadPhotoForSize(playerId, size, ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 24
0
 public void ResetAchievements(Action <SA_Result> callback)
 {
     #if API_ENABLED
     _ISN_GKAchievement_ResetAchievements(ISN_MonoPCallback.ActionToIntPtr(callback));
      #endif
 }
Ejemplo n.º 25
0
 public void RefreshRequest(ISN_SKReceiptDictionary dictionary, Action <SA_Result> callback)
 {
     #if API_ENABLED
     _ISN_SK_RefreshRequest(JsonUtility.ToJson(dictionary), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Request access to Event or Reminder data of EventKit by using EventStore
 /// </summary>
 public void EventKitRequestAccess(Action <SA_Result> callback, ISN_EntityType entityType)
 {
     #if UNITY_IPHONE && EVENT_KIT_ENABLED
     _ISN_EventKitRequestAccess(ISN_MonoPCallback.ActionToIntPtr <SA_Result> (callback), entityType.ToString());
     #endif
 }
Ejemplo n.º 27
0
 public void DeleteSavedGame(ISN_GKSavedGame game, Action <SA_Result> callback)
 {
 #if API_ENABLED
     _ISN_GKLocalPlayer_DeleteSavedGame(game.Name, game.Id, ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 28
0
 public void ShowGameKitView(ISN_GKGameCenterViewController view, Action <SA_Result> callback)
 {
     #if ((UNITY_IPHONE || UNITY_TVOS) && GAME_KIT_API_ENABLED)
     _ISN_GKGameCenterViewControllerShow(JsonUtility.ToJson(view), ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }
Ejemplo n.º 29
0
        public void AudioSessionRequestRecordPermission(Action <bool> callback)
        {
#if UNITY_IPHONE || UNITY_TVOS
            _ISN_AV_AudioSessionRequestRecordPermission(ISN_MonoPCallback.ActionToIntPtr(callback));
#endif
        }
Ejemplo n.º 30
0
 public void LoadGameData(ISN_GKSavedGame game, Action <ISN_GKSavedGameLoadResult> callback)
 {
     #if API_ENABLED
     _ISN_GKLocalPlayer_LoadGameData(game.Name, game.Id, ISN_MonoPCallback.ActionToIntPtr(callback));
     #endif
 }