コード例 #1
0
 public void Send(User[] users, int arrayCount, SendPushFinished sendPushFinished)
 {
     IntPtr[] userArray = new IntPtr[users.Length];
     for (int i = 0; i < users.Length; i++) {
         userArray[i] = users[i].innerUser;
     }
     ApplicasaPushSend(innerPush, userArray, userArray.Length, sendPushFinished);
 }
コード例 #2
0
ファイル: User.cs プロジェクト: OrLavee/Sample-App-Unity
 public static User[] GetUserArray(UserArray userArray)
 {
     User[] users = new User[userArray.ArraySize];
     #if UNITY_ANDROID
     AndroidJavaObject tempJavaObjectArray=new AndroidJavaObject(userArray.Array);
     #endif
     for (int i=0; i < userArray.ArraySize; i++) {
     #if UNITY_IPHONE
         IntPtr newPtr = Marshal.ReadIntPtr (userArray.Array, i * Marshal.SizeOf(typeof(IntPtr)));
         users[i] = new User(newPtr);
     #endif
     #if UNITY_ANDROID
         AndroidJavaObject tempJavaObject = tempJavaObjectArray.Call<AndroidJavaObject>("get",i);
         IntPtr newPtr = AndroidJNI.NewGlobalRef(tempJavaObject.GetRawObject());
         users[i] = new User(newPtr,new AndroidJavaObject(newPtr));
     #endif
     }
     return users;
 }
コード例 #3
0
 public void Send(User[] users, int arrayCount, SendPushFinished sendPushFinished)
 {
 }
コード例 #4
0
        public void Send(User[] users, int arrayCount, SendPushFinished sendPushFinished)
        {
            if(javaUnityApplicasaPushNotification==null)
                javaUnityApplicasaPushNotification = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaPushNotification");

            // CREATE NEW MESSAGE
            javaUnityApplicasaPushNotification.CallStatic("ApplicasaPushSend");

            // add recipients
            for (int i = 0; i < users.Length; i++) {
                javaUnityApplicasaPushNotification.CallStatic("ApplicasaAddRecipient", users[i].UserID);
            }

            javaUnityApplicasaPushNotification.CallStatic("setBadge", badge);
            javaUnityApplicasaPushNotification.CallStatic("setSound", sound);
            javaUnityApplicasaPushNotification.CallStatic("setTag", "{"+tag+"}");
            javaUnityApplicasaPushNotification.CallStatic("setMessage", message);

            javaUnityApplicasaPushNotification.CallStatic("setDispatchInMinutes",dispatch_time);

            // Send the Notification
            javaUnityApplicasaPushNotification.CallStatic("sendPush");
        }
コード例 #5
0
ファイル: User.cs プロジェクト: OrLavee/Sample-App-Unity
 public static User GetCurrentUser()
 {
     if(javaUnityApplicasaUser==null)
         javaUnityApplicasaUser = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaUser");
     User user = new User(AndroidJNI.NewGlobalRef(javaUnityApplicasaUser.CallStatic<AndroidJavaObject>("getCurrentUser").GetRawObject()));
     return user;
 }
コード例 #6
0
ファイル: User.cs プロジェクト: OrLavee/Sample-App-Unity
 public static User[] GetArrayWithQuerySync(Query query, QueryKind queryKind)
 {
     if(javaUnityApplicasaUser==null)
         javaUnityApplicasaUser = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaUser");
     AndroidJavaObject tempJavaObjectArray = javaUnityApplicasaUser.CallStatic<AndroidJavaObject>("ApplicasaUserGetArrayWithQuerySync", query.innerQueryJavaObject, (int)queryKind);
     User[] user;
     if(javaUnityApplicasaUser==null){
         user = new User[0];
     }else{
         int tempLength=tempJavaObjectArray.Call<int>("size");
         user = new User[tempLength];
         for (int i=0; i < tempLength; i++) {
             AndroidJavaObject tempJavaObject = tempJavaObjectArray.Call<AndroidJavaObject>("get",i);
             IntPtr newPtr = AndroidJNI.NewGlobalRef(tempJavaObject.GetRawObject());
             user[i] = new User(newPtr, new AndroidJavaObject(newPtr));
         }
     }
     return user;
 }
コード例 #7
0
ファイル: User.cs プロジェクト: OrLavee/Sample-App-Unity
 public static User GetCurrentUser()
 {
     User user = new User(ApplicasaGetCurrentUser());
     return user;
 }