Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Reign Unity Plugins (Win8/WP8, BB10, iOS, Android, ect...)

Discussion in 'Assets and Asset Store' started by zezba9000, Oct 1, 2013.

  1. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Yes if you are not using Scoreoid you can leave those blank.

    No that login screen is only for APIs that don't have native UI (like Scoreoid). It will not be used in GooglePlay stuff. Make sure to set your "Android_ScoreAPI = ScoreAPIs.GooglePlay,"
     
  2. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Ah ok, it all makes sense now!
    But after I set the API to google play the game crashes when the script is called. And no error is shown on logcat =/
     
  3. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Can you be more specific? Like after what method does the game crash? Maybe put a Debug.Log where you think it might be happening.
    Also I recommend setting your values int the Demo CS file and scene to as its easier to make sure stuff is working right to start out with.
     
  4. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    It's on Leaderboard Start().
    The crash also happens when I use the Demo CS.
    The only print that does not show is inside the authenticateCallback().
     
  5. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @totsboy I totally forgot to to say you need to set your 12 digit GameID in the Android Manifest.
    Code (csharp):
    1. <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ xxxxxxxxxxxx" />
    2. <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ xxxxxxxxxxxx" />
     
  6. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Hello all

    I have a little problem with IAP under iOS. I've manager to set everything up. Started game, logged using test user, bought IAP, but plugin says it cannot verify purchase. When I run restore IAP's, same happened. When I try to buy IAP again, iPad says that you already bought it.
    What could be wrong with Reign plugin? I do not want to publish game until I test it.

    Same game under android works without any problems.
     
  7. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Here is log. First one is buy, second is restore.

    -> applicationWillResignActive()
    -> applicationDidBecomeActive()
    2014-05-23 11:28:41.336 a2048[3187:60b] StoreKit: Validating Purchased
    2014-05-23 11:28:42.364 a2048[3187:60b] Validation failed
    2014-05-23 11:28:42.365 a2048[3187:60b] Buy Failed to validate receipt.
    -> applicationWillResignActive()
    -> applicationDidBecomeActive()
    2014-05-23 11:29:04.451 a2048[3187:60b] StoreKit: Validating Restored Item
    2014-05-23 11:29:04.751 a2048[3187:60b] Validation failed
    2014-05-23 11:29:04.752 a2048[3187:60b] Restore Failed to validate receipt.
    a8402noads : False
     
  8. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    There is a bug in the iOS IAP system that will be pushed up in a fix tomorrow.
    For now download and install these patched files: https://www.dropbox.com/s/80bziy4zksjzpw4/iOS_Patch.zip
    But make sure you ran updates first!! "Edit->Reign->Check for updates"
    Also make sure you set your iOS SecretKey and its value is correct.
     
    Last edited: May 23, 2014
  9. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    I will check it.
    I also ran update and key is ok.
     
  10. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Still not working
    2014-05-23 12:31:24.527 a2048[3266:60b] StoreKit: Purchasing
    -> applicationWillResignActive()
    -> applicationDidBecomeActive()
    -> applicationWillResignActive()
    -> applicationDidBecomeActive()
    2014-05-23 12:31:35.355 a2048[3266:60b] StoreKit: Validating Purchased
    2014-05-23 12:31:36.200 a2048[3266:60b] Validation failed
    2014-05-23 12:31:36.201 a2048[3266:60b] Buy Failed to validate receipt.
     
    Last edited: May 23, 2014
  11. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Ok, that fixed it!
    But for some reason the banner ads are not showing anymore after this last update. Nothing happens when I call it.

    edit: banners still working on wp8, only stopped on android
     
    Last edited: May 23, 2014
  12. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @XRayAdams Could you send a Unity proj repo case to support@reign-studios.com and I will try to reproduce your issue if you would like.
    Also validate you didn't miss any basic steps here: http://www.reign-studios.net/docs/unity-plugin/ios/

    What device type, device OS and iOS target version are you using?
     
    Last edited: May 23, 2014
  13. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    AdMob or Amazon Ads? And are you setting the "Android_AdAPI" field in the AdDesc object?
     
  14. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Admob!
    Yep, I did no change to that in any regard, it was working fine before the update.
    On WP8 it's still working, problem is only on android.
     
  15. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Its working in my code base. When the update comes out today, the GooglePlayServices lib will also be updated which is where the AdMob API lives, so we can see if you are still having issues then.
     
  16. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Ok, let me know when it's up!
     
  17. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Couple updates pushed out!

    1) New feature: Added in a feature that lets you get the IAP product price from the remote server!

    2) Updated GooglePlayServices and AdMob to newest version.

    3) Fixed Amazon Ads gravity bug.

    4) Fixed memory bug in iOS IAP validation.
     
  18. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Still not showing banner after the update. Not sure what might be wrong since the code is the same for wp8 and works there.
    The interstitial add is still working on android also.
     
  19. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    I will take a closer look to see if something is wrong tomorrow, but it was working on my device before I released.
    If you have had any recent app crashes, AdMob can get messed up iv'e noticed sometimes. You should try to restart your device and run the app again.

    What device and Android version are you testing with?
     
  20. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Galaxy Trend Lite, android 4.1.2
    Already tried restarting device, unnistaling the game, clean build, etc.
     
  21. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Also, I have activated the leaderboards script again, and it's crashing again (after the last update) =/
     
  22. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Can you give a logcat output for the leaderboard issue?
    Also if you are able, could you send a repo case Unity project to support@reign-studios.com. Might make it a lot faster to figure out whats wrong.

    Also try running updates on your Android SDK. I wonder if something is really out of date in there.
     
    Last edited: May 24, 2014
  23. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Update

    Released experimental MM Ads for BB10 (Also works in Editor).
    Everything seems to be working so far. Just set up a MM account and WebSite App in there dashboard (https://tools.mmedia.com/apps/appsDashboard), then email support that you are using Web Ads in a Unity3D BB10 App.

    New feature: Load animated GIF images in Unity3D.
    Use like so:
    Code (csharp):
    1. gifImage = new TextureGIF(stream, frameUpdatedCallback);
    2. drawImage = gifImage.CurrentFrame.Texture;
    3. private void frameUpdatedCallback(TextureGIFFrame frame)
    4. {
    5.     adImage = frame.Texture;
    6. }
    Also for Windows8.1 and WP8 users, I recommend updating Visual Studios 2013 with Update 2 as this is what the plugin is built against.
    For Android users I recommend updating your Android tools to the latest version.
    For iOS users I recommend making sure all your xCode tools are up to date.
     
    Last edited: May 26, 2014
  24. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Hello

    I cannot send you whole project as this is production game. It has no problems on WP/Android platform, only IAP in iOS.
    If you want I can give part of code to check, but I do not think that there are any problems in it as this part of game works under WP/Android.

    I will check today your latest updated version
     
  25. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Nope.
    Same error

    -> applicationWillResignActive()
    -> applicationDidBecomeActive()
    2014-05-26 15:09:57.056 a2048[3623:60b] StoreKit: Validating Restored Item
    2014-05-26 15:09:58.293 a2048[3623:60b] Validation failed
    2014-05-26 15:09:58.294 a2048[3623:60b] Restore Failed to validate receipt.
    a8402noads : False

    Also I want to remind that I am working with test user. I do not think this should be a problem as this is the only way to test IAP in iOS.
     
    Last edited: May 26, 2014
  26. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    BTW. I also got this warning from Xcode

    2014-05-26 15:11:57.095 a2048[3623:60b] <Google:HTML> Google Mobile Ads SDK: You are currently using 6.8.0 of the SDK. A new version, 6.9.2, is available at http://goo.gl/Zc0BYt . Please consider updating your SDK to get the latest features and bug fixes
     
  27. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    My management will kill me. I recommended to buy this plugin and it was okay until we made iOS version! :(

    Please help
     
    Last edited: May 26, 2014
  28. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    And another one :)

    Calling this

    Reign.MarketingDesc desc=new Reign.MarketingDesc();
    desc.iOS_AppID="here goes id of our app";
    Reign.MarketingManager.OpenStoreForReview(desc);

    brings AppStore but with empty square :( It does not open our application.
     
  29. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Leaderboard issue was on appmanifest, it was changed when updated.
    Updated android SDK and Reign, still not showing the ad banner =/
     
  30. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @XRayAdams What iOS Device and OS version are you using?
    iOS 5.1, 6, 7 ??

    Validation on iOS 6 3GS 7 iPad Mini works everytime for me. If you can give any code that shows what values you are setting (without the real ones) it might help. Sounds like something is wrong with your "Secret Key" and if not then I will add in a feature that will disable this for you, but this should be working.

    Also AdMob for iOS will be updated in next release.
     
    Last edited: May 26, 2014
  31. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    I'm going to see if I can't get some more test devices to reproduce with. Do you have any other devices that you can reproduce the issue with?
    My Android 4.0.1 doesn't seem to have the issue.

    Does the Ad Refresh but just not show in any of your tests?
     
  32. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @ totsboy: Update pushed out that fixes your Android AdMob bug.

    @XRayAdams iOS AdMob has been updated.
     
  33. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Nop, only have one =/


    Sorry, did not understand what you mean.
     
  34. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Xcode tha last one, Unity last one

    Here is code for IAP initialization

    Code (csharp):
    1. {
    2.         #if UNITY_ANDROID
    3.         var inAppIDs = new InAppPurchaseID[]
    4.         {
    5.             new InAppPurchaseID("_____________", InAppPurchaseTypes.NonConsumable),
    6.         };
    7.         #elif UNITY_WP8
    8.         var inAppIDs = new InAppPurchaseID[]
    9.         {
    10.             new InAppPurchaseID("___________", InAppPurchaseTypes.NonConsumable),
    11.         };
    12. #elif UNITY_IOS
    13.         var inAppIDs = new InAppPurchaseID[]
    14.         {
    15.             new InAppPurchaseID("________", InAppPurchaseTypes.NonConsumable),
    16.         };
    17. #endif
    18.         var appDesc = new InAppPurchaseDesc()
    19.         {
    20.             Testing = false,
    21.             Editor_InAppIDs = inAppIDs,
    22.  
    23.             iOS_AppleStore_InAppIDs=inAppIDs,
    24.             iOS_InAppPurchaseAPI=InAppPurchaseAPIs.AppleStore,
    25.             iOS_AppleStore_SharedSecretKey="here is my secret code from apple",
    26.         };
    27.        
    28.         InAppPurchaseManager.Init(appDesc, IAPInitDone);
    29.     }
     
  35. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @XRayAdams You must set testing to "true". You cannot test the iOS IAP system without setting "Testing = true" and you must login with a iTunes Connect Test User. Login to iTunes Connect, then click on Manager Users and add a test user. After that logout of your main user on your iPad or iPhone and run the game.

    Also what iOS operating system version are you testing with?
     
  36. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    I use last ios 7.1. As about testing = true. Apple making this testing for us by providing ability to create test user in sandbox and without adding anything to the IAP code in ios applications. I already developed applications with IAPs and I know how to work with it.
    Can you guarantee that settings testing=false in production release mode WILL works? I do not understand how this flag in your plugin can change anything, but as you developer of it, I will assume you know what you are talking about :)

    Thank you.

    And one more suggestion. Update your web site with better help. This could help you to prevent a lot of bug reporting which are not the bugs :)
     
  37. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Getting this when trying to update
    IOException: Sharing violation on path D:\Projetos\Tap Master\Assets\Plugins\Reign.dll
     
  38. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Sorry about the last post, sometimes its hard to judge if someone has setup everything correctly and I didn't mean to be rude if I came off that way. Just trying to make sure I understand the situation before spending hours trying to fix an issue that isn't broken.

    Yes. All this does is change the Apple server URL for which a live app will verify purchases against. But you must set this to true for testing IAP on a game that has not been released yet as it validates on a test server instead. So I hope that was your issue as it looks like it might have been?

    Yes this is actually going to happen very soon as this is an issue.
     
  39. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    This will be fixed in the next release. Unity seems to lock files in a way that messes up the "FileStream" object without a special setting being set on it.
    For now download a Unitypackage to update.
     
  40. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Still not working after the update, the interstitial also not working now =/
     
  41. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm running into build errors within Visual Studio Express 2013 and I'm trying to eliminate Reign plugin for W8 as a source. On the documentation, it says that I should manually reference "Assets/Plugins/Metro/Reign.dll" in Visual Studio. Can you explain how to do this? I'm completely new to Visual Studio.
     
  42. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Because your files were locked, I would manually delete them then re-install the plugin.
    Can you install and run this test app on your device: https://www.dropbox.com/s/jfdwaxwy50gu1pu/Android_Build.apk
    That works on Android 4.0.1 and Android 2.3.4 test devices with different DPIs.

    If it does not work for you, can you paste your logcat of the values:
    Screen DPI:
    Scaled Ad Width:
    Scaled Ad Hieght:
     
    Last edited: May 28, 2014
  43. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Sounds like you need to delete your existing Visual Studios project and do a clean new build from Unity or it will not add the Reign.dll for you. Although I don't understand your wording by "eliminate Reign" ?
     
  44. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks ... I just meant remove Reign as a possible cause of the build errors. I have already tried deleting the Visual studio project and doing a clean re-build, so I'm guessing that's not the issue.
     
  45. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    What are your build errors? You need to run updates on Visual studios "Tools->Extensions and Updates", then navigate to "Updates" and install everything available.
    Also make sure you install this MS-Ads SDK version for WP8 if you have not already: http://www.reign-studios.net/index.php/download_file/view/29/215/
     
  46. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    After deleting the plugin I'm getting this error when trying to import (from either the package or from the store):
    $errorreign.jpg
     
  47. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @totsboy You need quit Unity and manually delete that whole folder. Unity locks the TEMP folder and sometimes Assests for some reason I don't understand. Either way after the next update this should not be an issue again.
     
  48. bmmshayan

    bmmshayan

    Joined:
    May 20, 2014
    Posts:
    21
    How to call a banner (InterstitialAd) from another script (JS)?

    Give an example of code that will use InterstitialAd from JS-script.
     
  49. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    You should really learn some basic C# as its almost the same thing but offers a lot more features then UnityScript.
    This is converted, but you must convert the "Object Initializer":
    Code (csharp):
    1. // -----------------------------------------------
    2. // Documentation: [url]http://www.reign-studios.net/docs/unity-plugin/[/url]
    3. // -----------------------------------------------
    4.  
    5. // using UnityEngine;
    6. // using System.Collections;
    7. // using Reign;
    8.  
    9. public class InterstitialAdDemo extends MonoBehaviour
    10. {
    11.     private static var ad: InterstitialAd;
    12.  
    13.     private function Start()
    14.     {
    15.         DontDestroyOnLoad(gameObject);// Make sure the start method never gets called more then once.
    16.  
    17.         var desc = new InterstitialAdDesc()
    18.         {
    19.             Testing = true,
    20.             EventCallback = eventCallback,
    21.  
    22.             // WP8
    23.             WP8_AdAPI = InterstitialAdAPIs.AdMob,
    24.             WP8_AdMob_UnitID = "",// NOTE: Must set event for testing
    25.            
    26.             // iOS
    27.             iOS_AdAPI = InterstitialAdAPIs.AdMob,
    28.             iOS_AdMob_UnitID = "",// NOTE: Must set event for testing
    29.            
    30.             // Android
    31.             Android_AdAPI = InterstitialAdAPIs.AdMob,
    32.             Android_AdMob_UnitID = ""// NOTE: Must set event for testing
    33.         };
    34.  
    35.         ad = InterstitialAdManager.CreateAd(desc, createdCallback);
    36.     }
    37.  
    38.     private function createdCallback(success: boolean)
    39.     {
    40.         Debug.Log(success);
    41.         if (!success) Debug.LogError("Failed to create InterstitialAd!");
    42.     }
    43.  
    44.     private function eventCallback(adEvent: InterstitialAdEvents, eventMessage: String)
    45.     {
    46.         Debug.Log(adEvent);
    47.         if (adEvent == InterstitialAdEvents.Error) Debug.LogError(eventMessage);
    48.         if (adEvent == InterstitialAdEvents.Cached) ad.Show();
    49.     }
    50.  
    51.     private function OnGUI()
    52.     {
    53.         GUI.matrix = Matrix4x4.identity;
    54.         GUI.color = Color.white;
    55.  
    56.         if (GUI.Button(new Rect(0, 0, 128, 64), "Show Ad"))
    57.         {
    58.             ad.Cache();
    59.         }
    60.     }
    61.  
    62.     private function Update()
    63.     {
    64.         // NOTE: If you are getting unity activity pause timeout issues on Android, call "ApplicationEx.Quit();"
    65.         // There seems to be what may be a memeory leak in Unity4.3+
    66.         // Until this is fixed I recomend trying to calling this quit method on Android.
    67.         // (It will save your player prefs and use "System.exit(0)" instead of "finish()" on Android)
    68.         // If you have a better work-around, email support, Thanks.
    69.         if (Input.GetKeyUp(KeyCode.Escape)) ApplicationEx.Quit();
    70.     }
    71. }
     
  50. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Also note, all UnityScript docs are now listed under general docs: http://www.reign-studios.net/docs/unity-plugin/