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);
 }
Esempio n. 2
0
 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;
 }
 public void Send(User[] users, int arrayCount, SendPushFinished sendPushFinished)
 {
 }
        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");
        }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
 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;
 }
Esempio n. 7
0
 public static User GetCurrentUser()
 {
     User user = new User(ApplicasaGetCurrentUser());
     return user;
 }