public static UpgradeVG GetLastUpgradeForVirtualGood(string goodItemId) { #if UNITY_ANDROID && !UNITY_EDITOR UpgradeVG vgu = null; AndroidJNI.PushLocalFrame(100); using (AndroidJavaObject jniUpgradeVG = AndroidJNIHandler.CallStatic <AndroidJavaObject>( new AndroidJavaClass("com.soomla.store.data.StoreInfo"), "getGoodLastUpgrade", goodItemId)) { vgu = new UpgradeVG(jniUpgradeVG); } AndroidJNI.PopLocalFrame(IntPtr.Zero); return(vgu); #elif UNITY_IOS && !UNITY_EDITOR IntPtr p = IntPtr.Zero; int err = storeInfo_GetLastUpgradeForVirtualGood(goodItemId, out p); IOS_ErrorCodes.CheckAndThrowException(err); string json = Marshal.PtrToStringAnsi(p); Marshal.FreeHGlobal(p); JSONObject obj = new JSONObject(json); return(new UpgradeVG(obj)); #else return(null); #endif }
public void onGoodUpgrade(string message) { StoreUtils.LogDebug(TAG, "SOOMLA/UNITY onGoodUpgrade:" + message); string[] vars = Regex.Split(message, "#SOOM#"); VirtualGood vg = (VirtualGood)StoreInfo.GetItemByItemId(vars[0]); UpgradeVG vgu = (UpgradeVG)StoreInfo.GetItemByItemId(vars[1]); Events.OnGoodUpgrade(vg, vgu); }
/// <summary> /// Gets the first upgrade for virtual good with the given <c>goodItemId</c>. /// </summary> /// <param name="goodItemId">Item id.</param> /// <returns>The first upgrade for virtual good with the given id.</returns> protected override UpgradeVG _getFirstUpgradeForVirtualGood(string goodItemId) { UpgradeVG vgu = null; AndroidJNI.PushLocalFrame(100); using(AndroidJavaObject jniUpgradeVG = AndroidJNIHandler.CallStatic<AndroidJavaObject>( new AndroidJavaClass("com.soomla.store.data.StoreInfo"),"getGoodFirstUpgrade", goodItemId)) { vgu = new UpgradeVG(jniUpgradeVG); } AndroidJNI.PopLocalFrame(IntPtr.Zero); return vgu; }
/// <summary> /// Gets the last upgrade for the virtual good with the given <c>goodItemId</c>. /// </summary> /// <param name="goodItemId">item id</param> /// <returns>last upgrade for virtual good with the given id</returns> override protected UpgradeVG _getLastUpgradeForVirtualGood(string goodItemId) { UpgradeVG vgu = null; AndroidJNI.PushLocalFrame(100); using (AndroidJavaObject jniUpgradeVG = AndroidJNIHandler.CallStatic <AndroidJavaObject>( new AndroidJavaClass("com.soomla.store.data.StoreInfo"), "getGoodLastUpgrade", goodItemId)) { vgu = new UpgradeVG(jniUpgradeVG); } AndroidJNI.PopLocalFrame(IntPtr.Zero); return(vgu); }
public static UpgradeVG GetFirstUpgradeForVirtualGood(string goodItemId) { #if UNITY_ANDROID && !UNITY_EDITOR UpgradeVG vgu = null; AndroidJNI.PushLocalFrame(100); using(AndroidJavaObject jniUpgradeVG = AndroidJNIHandler.CallStatic<AndroidJavaObject>( new AndroidJavaClass("com.soomla.store.data.StoreInfo"),"getGoodFirstUpgrade", goodItemId)) { vgu = new UpgradeVG(jniUpgradeVG); } AndroidJNI.PopLocalFrame(IntPtr.Zero); return vgu; #elif UNITY_IOS && !UNITY_EDITOR IntPtr p = IntPtr.Zero; int err = storeInfo_GetFirstUpgradeForVirtualGood(goodItemId, out p); IOS_ErrorCodes.CheckAndThrowException(err); string json = Marshal.PtrToStringAnsi(p); Marshal.FreeHGlobal(p); JSONObject obj = new JSONObject(json); return new UpgradeVG(obj); #else return null; #endif }