Prime31 Unity Plugins Officially Live! [CLOSED]

Discussion in 'iOS Development' started by prime31, Aug 27, 2010.

  1. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @NGGS, you only want to add the event handler once. Call it in OnStart or OnEnabled. For example usage just drop the StoreKitEventListener prefab in your scene and watch the logs in Xcode.
  2. nggs

    nggs

    New Member

    Joined:
    Oct 23, 2009
    Messages:
    90
    awesome, thanks for the fast response. Is that true for ALL event listeners? I'm doing purchaseSuccessful in Update right now, and that seems to work ok. Would it be better to move it?
  3. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @NGGS, that is true of all event listeners always. Definitely, definitely, definitely move it out of Update. Also be sure to remove them with "-=" in OnDisable or when you are done with them.

    I will be putting up a couple short video tutorials on using events (and a few other topics) soon. It pains me to know that there are so many people out there coding their games the hard way :)
  4. sparkyman

    sparkyman

    New Member

    Joined:
    May 3, 2009
    Messages:
    21
    Hi Prime31

    I am using the StoreKit plugin and want to know how I can get a pop up dialog box explaining the error that has been received. If I put the device into airplane mode and press my "buy" button nothing is shown on the device just errors in the console log , how can I get these to the user?

    errors on the console log are:
    productListRequestFailed: Cannot connect to iTunes store

    EDIT: Have created a panel to show a generic error - thanks
    Last edited: Dec 17, 2010
  5. bumba

    bumba

    New Member

    Joined:
    Oct 10, 2008
    Messages:
    358
  6. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @bumba, we haven't had many requests for either Adwhirl or Tapjoy. It seems Mobclix and iAd handle most everyones ad needs. If there is ever enough requests for a plugin we will always build it.

    By far the most requested plugin is Augmented Reality so we will finally have one coming real soon. Here are some short demo clips of the plugin in action: here and here.
  7. immersiva

    immersiva

    New Member

    Joined:
    Mar 27, 2010
    Messages:
    57
    Hi,

    Using mobclix plugin here.
    How do I set a greater ad, like a fullscreen ad or, at least a 320x250 one?

    TIA
  8. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @Immersiva, the plugin currently only supports standard iPhone and iPad sized ads.
  9. immersiva

    immersiva

    New Member

    Joined:
    Mar 27, 2010
    Messages:
    57
    Ok.
    It would be great if the plugin let we use 320x250 centered ads, at least.
    Are there any plans to do so?
    If not, how would I start changing the scripts to make it happen?

    I.
  10. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @Immersiva, there are currently no plans for the larger ads. Until their are enough advertisers out there to fill them it just doesn't pay to have the support. If you want to jump in and code it yourself you will first want to get familiar with the Mobclix SDK. Once you know the details of how the SDK works you should be able to plug the changes into the MobclixManager.mm file without too much trouble. The trickiest part is handling orientation changes which all needs to be done 100% manually. Unity does not autorotate like a standard iOS app so you need to handle all transform matrix rotations and translations yourself.
  11. Dreamora

    Dreamora

    Member

    Joined:
    Apr 5, 2008
    Messages:
    26,586
    I would like to request such a support as well.
    I can add it myself, thats no problem, but it would make updates much more troublesome so should I do it myself I'll provide you with the implementation so you can include it in the future :)


    What I basically would like to see is:

    1. An enum (one for iPhone, 1 for iPad) to decide which banner type to show
    2. The possibility to define the rect of this banner or at least its top left position. Both in pixels cause Unity has no concept of screen points

    cause for appealing ad integration, the enforced positions don't work too well as you can't integrate them in your design.
  12. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @dreamora, it would take a bit more than just an enum for iPhone and iPad. You have to properly handle iPhone 320x50, iPhone 320x250, iPad 300x250, iPad 468x60, iPad 120x600 and iPad 728x90. The framework would probably be fairly simple to get it up and running with seeing as how it was designed for arbitrary screen and ad sizes.
  13. Dreamora

    Dreamora

    Member

    Joined:
    Apr 5, 2008
    Messages:
    26,586
    Don't see why it would need more as I've checked the code and mobclix api cause I currently can't get the banner to show up with the mobclix plugin in my 3.1 iPad game (not show up means I get that annoying error banner telling me that something is incorrect), while the mobclix sdk example works fine on the ipad ...

    But perhaps the one liner wasn't clear :)

    What I'm talking about is

    Code (csharp):
    1.  
    2. public enum MobclixIPadBanner
    3. {
    4.   ad160x600 = 0,
    5.   ad300x250,
    6.   ad468x60,
    7.   ad728x90
    8. }
    9.  
    10. public enum MobclixIPhoneBanner
    11. {
    12.   ad300x250 = 0,
    13.   ad320x50
    14. }
    and then passing over the int to the objc code and switching it to use the correct constant over there and init the rect at the right size.
    Mobclix on this end luckily is easy enough by only offering for descrete options, with flexible size it would definitely be hell :) (apple went a step further, defining what sizes are acceptable depending on the device independent of the existing standards and mobclix more sooner than later will adopt and focus on these sizes as most mobile advertising streams will likely too so they don't lose field due to not being "interchangeable with iAd"

    Whats definitely a tad more complex is the possibility to define the position, at least if we assume that it checks correctness (ie will the whole rect be within the screen)
  14. mikolo

    mikolo

    New Member

    Joined:
    Nov 27, 2009
    Messages:
    245
    hello together, i have the following warning in my app, when i build with the latest final xCode 3.2.5 and SDK 4.2:

    PHP:
    ShowBannerBottom (Filename: /Users/build/builds/unity-iphone/iphone/Projects/../Runtime/Export/Generated/BaseClass.cpp Line1719)
    2010-12-22 05:21:59.247 baby-ninja-jump[1438:307ADBannerViewADBannerContentSizeIdentifier320x50 is deprecatedplease use ADBannerContentSizeIdentifierPortrait instead
    Can i change something in code to fix this? Somebody knows?

    thanks for help:)
  15. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @Mikolo, as long as you have your Base SDK set to 4.2 you can disregard the warning. The older symbols are required for iOS 4.0 and 4.1.
  16. mikolo

    mikolo

    New Member

    Joined:
    Nov 27, 2009
    Messages:
    245
    ok but the banners are also shown on iphone4? ... because of other resolution?
  17. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @mikolo, iOS UIView coordinates are in points, not pixels so the iPhone 4 is no different than the other non-retina devices.
  18. mikolo

    mikolo

    New Member

    Joined:
    Nov 27, 2009
    Messages:
    245
    thanks for quick reply.. we are all workoholics :)
  19. Rod Galvao

    Rod Galvao

    Member

    Joined:
    Dec 12, 2008
    Messages:
    83
    @prime31
    @immersiva
    @dreamora

    +1
    That's a chicken-egg problem. You'll have more custormers once you implement other kinds (sizes) of ads.
    For us, it is a must. Please consider implementing then, I'd love to buy your plugin and get going with my project.

    RGalvao
  20. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    OK, OK, OK. You guys win. The next update has a totally fresh API. It has a ton more power but of course that power comes with added complexity. Supporting all 4 orientations will now need to be done manually. Supporting the 2 landscapes or the 2 portraits will still be automatic. I figured that would be a good tradeoff in return for the power. The prefab will still be there for people to fallback on if they want a zero coding solution that works on iPhone and iPad. It will have just a simple centered banner in either landscape or portrait.

    Here are the new supported ad types:

    Code (csharp):
    1. public enum MobclixBannerType
    2. {
    3.     iPhone_320x50,
    4.     iPhone_300x250,
    5.     iPad_300x250,
    6.     iPad_728x90,
    7.     iPad_120x600,
    8.     iPad_468x60
    9. }
    Here is a screenshot of one of those ugly, box-like ads on the iPad:

    $shot.png

    The API will now have a couple methods changed:

    // Creates a banner of the given type with the x and y offset of the top-left corner of the ad
    createBanner( MobclixBannerType bannerType, float xPos, float yPos )

    // Hides the banner optionally destroying it completely. The banner must be destroyed if you want to change
    // the MobclixBannerType
    public static void hideBanner( bool shouldDestroy )

    If there are any daring individuals who have already purchased the plugin and would like to test out the new changes shoot me an email to questions (at) prime31.com with Mobclix Beta in the subject.
  21. outtoplay

    outtoplay

    Member

    Joined:
    Apr 29, 2009
    Messages:
    690
    Don't suppose the good folk at Prime31 are running a Holiday Special?

    Ho ho ho
    B.
  22. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    Our "Holiday Special" will be another free update to the Mobclix Plugin with support for all six ad types and fully customized ad location along with the release of the Augmented Reality Plugin. It's tough to chop prices when they are rock bottom.
  23. susantio

    susantio

    New Member

    Joined:
    Jul 14, 2009
    Messages:
    97
    Hello, I bought the facebook/twitter plugin I am getting an Invalid OAuth 2.0 Access Token when the player tries to login to facebook. Does anyone have a clue what the problem is? It was working fine before but then suddenly I keep getting this error whenever I try to login.
    basically I just created a button that fires up the following code:
    init( applicationId )
    login ()
  24. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @susantio, the only time I have ever seen Facebook return that error is when the application ID was wrong or missing.
  25. unityandyou

    unityandyou

    New Member

    Joined:
    Jun 25, 2010
    Messages:
    50
    Awsome! I love them!!! do i need to give you credit?
  26. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @unityandyou, not at all.
  27. Hilm

    Hilm

    Member

    Joined:
    Nov 2, 2007
    Messages:
    316
    Hey - am still getting problems getting iAd to play nicely with Mobclix... I'm trying to submit an update to fix iAd's crashing the app, but I can't even get the test-adds to appear anymore...

    I have the app setup, Mobclix test add's are working; but once I allocate some of the traffic to go to iAd's no add's appear at all (have tried opening 20-30 times with no iAd's so it's not the 30% failed adds apple send etc?)

    Anyone else experiencing this issue using the latest version of the plugin/ Mobclix SDK?

    I've spoken to Mobclix and they we're looking into it in case it was an issue with their SDK (but it's been quite a while and not heard back from them and it's getting frustrating loosing out on the additional revenue).


    UPDATE: Ok having changed the bundle ID I now have test add's appearing on 4.x devices. Test add's are crashing the device on pre 3.x devices however... Any thoughts?

    UPDATE AGAIN: Ok with a bit more digging it appears iAd's don't work on pre 4.0 OS's (and cause crashes)... Is there any chance of either getting mobclix to not try and serve iAd's to non-capable devices, or get an update for the plugin to simply not try serve an iAd regardless what Mobclix says on pre 4.0 devices?
    Last edited: Dec 26, 2010
  28. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @Hilm, all the Mobclix code is closed source so I have no way of telling where the ad is being served from. Mobclix should be checking for iAd support before sending iAds for sure. If that isn't the case open a ticket with Mobclix support and cc Adam@Mobclix.com on the email.
  29. deepak

    deepak

    New Member

    Joined:
    Aug 10, 2010
    Messages:
    44
    Hi

    I am developing a unity iphone application using prime31 Social Networking plungin for posting on facebook and twitter accounts.

    I got "Consumer key" and "Consumer secret" for twitter account. Can anyone help me how to proceed with "Consumer key" and "Consumer secret" for posting on twitter?

    Thanks in advance
  30. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @deepak, have a look at the test scene included with the plugin to see how to use all of the Twitter integration's features. Also be sure to check out the docs. The first method you need is both in the test scene and the docs:

    // Initializes the Twitter plugin and sets up the required oAuth information
    public static void init( string consumerKey, string consumerSecret )
  31. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    Hi Prime31, I just purchased the Mobclix plugin and have a few questions:

    1. I just registered on the Mobclix site. I currently do not have my app live on the AppStore, I'm still developing it. Can I only add Mobclix to my app when it is on the AppStore? Or is there a way to get this plugin working while I am still developing? I would like it so that I can see how it is going to look and function before it goes live. If I can get it to work while I'm in development, I won't be able to setup allocation for other ad networks and test them correct?

    2. Does your plugin integrate the Mobclix SDK to xCode or do I have to do that separately, then do what I need to do in Unity to make it work?

    3. Since I am using Unity iPhone Pro (1.7), I am unable to check out the test scenes/prefabs etc. So knowing this I tried to set one up myself and I receive a few errors:

    Assets/Editor/Prime31/MobclixMenuItem.cs(73,34): error CS0246: The type or namespace name `var' could not be found. Are you missing a using directive or an assembly reference?

    Thanks for the help, I am new to Mobclix and your plugins. If you can offer any other tips I'd appreciate it.
    Last edited: Dec 28, 2010
  32. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @cory.stpierre, to answer your questions:

    1. you can most definitely set everything up before your app is in the App Store. Just create your app in the Mobclix portal set Test Mode to yes.

    2. you don't need to do anything at all in Xcode. The library will be imported and all the proper frameworks will be linked. Just be sure you use Build from Unity (not Build and Run).

    3. Input.DeviceOrientation is the same as iPhoneSettings.screenOrientation. You can recreate the prefab and test scene very easily by just adding the MobclixAdapter.cs script to a GameObject in your scene and swapping the Input.DeviceOrientation for iPhoneSettings.screenOrientation.
  33. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    Thanks for the quick reply. I have got my app now in test mode. They made it kinda hard for the developer to understand that they can make changes to their app after they initially create it. Anyhow that's not your fault and thanks for the help.

    It's good to know that I do not need to do anything in xCode :). I am assuming you bundle all of the SDK yourself. I think I saw that the version you support in the latest version of the plugin is v4.2.1.

    As new versions of Mobclix come out will you update the plugin?

    I fixed the input errors, but I am getting an error in one of the editor files:

    Assets/Editor/Prime31/MobclixMenuItem.cs(73,34): error CS0246: The type or namespace name `var' could not be found. Are you missing a using directive or an assembly reference?
  34. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @cory.stpierre, you can just delete the MobclixMenuItem.cs file. It is only needed if you will be using Admob in addition to Mobclix. There is a plugin update coming out in a few days with the new version of Moblix SDK.
  35. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    Yes! Got it running finally. Tossing out that file did the trick. However if I do want to integrate AdMob, given my situation (Unity iPhone 1.7) how would I go about doing that? I'll muddle over the code and try things on my end. Would be great to have full functionality.

    Other than that everything works great. Thanks Prime.
  36. nathanc

    nathanc

    New Member

    Joined:
    May 2, 2009
    Messages:
    6
    Hi Prime31,

    Firstly thanks for producing these awesome plugins, they've saved me a heap of time. :D

    However I'm having problems getting Twitter to work. I followed your documentation and requested approval for xAuth access but got rejected as they don't allow test applications?? They suggested obtaining a access token for a single account here http://dev.twitter.com/pages/oauth_single_token

    I then used the new Access Token and Access Token Secret generated for my account in the script "S_N_GUIManager.cs" and still get the error message "Twitter login failed: Failed to validate oauth signature and token" in the console? Can you please help me?

    thanks,
    Nathan
  37. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    Hi Prime, I fixed those errors and got Admob working. Thanks again.
  38. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @nathanc, you won't be able to authenticate without Xauth access. I would suggest that you don't tell Twitter it is a test app. They usually have no problem granting Xauth to legit applications.

    @corey, I'm guessing you figured out you just need to rename the post process script to get Admob going.
  39. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    It was that, plus having to swap out "var" for the actual data-type. Unity iPhone 1.7 is .NET 2.1 compatible, so it doesn't quite have all of c-sharp's features like implicitly typed local vars. No biggie though.

    EDIT:

    I have been testing Mobclix with different orientations and have it working the way I want it, however the Browser view (the view that appears once you click the add) does not orient itself properly in certain situations.

    Specifically it messes up when the device gets tilted to FaceUp or FaceDown from any orientation other than Portrait.

    Since my game is orientation friendly, I wanted it to work even if the device gets put face up (no one really plays a game face down :)).

    Now since I did not see the .m file for the Browser view, only the .h, I cannot alter it myself. Is this something that you can do on your end, or is this something I should put in a ticket for? Or has the new SDK taken care of this? Thanks.

    EDIT 2:

    I put in a ticket for this issue on the Mobclix site in the meantime. I'll post back here if I find anything out.
    Last edited: Dec 28, 2010
  40. CapnJ

    CapnJ

    New Member

    Joined:
    Aug 6, 2009
    Messages:
    29
    Hello, saw your AR plug-in went live today. Congrats mate! I did have a couple of questions tho:

    - Does it have any marker detection like the QCAR plugin for Android?

    - Is everything good for app store submission via TOS n' such?

    Thanks mate,
    CapnJ
  41. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @CapnJ, the plugin doesn't have marker or edge detection built in. I assume thats what QCAR is though I am not familiar with it. As with all our plugins, we only use public API's. We wouldn't want to have our apps rejected for private API use and we're pretty sure you wouldn't either.
  42. CapnJ

    CapnJ

    New Member

    Joined:
    Aug 6, 2009
    Messages:
    29
    Awesome mate! Thanks for the quick reply. Pretty sure there would be a way to integrate ARtoolkit libraries to get some detection going. Thanks again!

    CapnJ
  43. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @CapnJ, you can absolutely integrate the libraries. There is a spot where you have the raw data that you can do whatever you want with it.
  44. deepak

    deepak

    New Member

    Joined:
    Aug 10, 2010
    Messages:
    44
    Hi Prime,

    I have a few questions regarding Social Networking Plugin.

    1) I am able to post to user's wall in facebook, but unable to proceed with posting to facebook fans page. Can someone briefly explain the procedure as prime31 docs were not in detail.

    2) For twitter, how to get login interface in iphone?

    3) I tried by passing predefined user name and password to TwitterBinding.login () after initialising the twitterBinding.init with consumer key and consumer secret. I got below error:

    Twitter login failed: <?xml version="1.0" encoding="UTF-8"?>
    <hash>
    <request>/oauth/access_token</request>
    <error>Client application is not permitted to use xAuth.</error>
    </hash>

    Any solution?

    Thanks in advance
  45. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @deepak, for number 1 you need to check the Facebook docs for the proper Graph API path and parameters then just feed them to the custom graph request. As for Twitter, it sounds like you didn't email Twitter to get Xauth access for your app. You will need to do that before you can use the login and other methods. Xauth has no UI available. You can create a login page to match your games style in Unity.
  46. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    Hi Prime31.

    I recently updated my project to the latest version of the Mobclix plugin (4.2.2) and I am experiencing an error. When I click on the ad banner, the browser view loads fine and all, but when I close it out, the ad banner's position reverts to 0,0.

    I think it's grabbing the identity matrix after closing the browser view, because it goes to 0,0 whether it's in Landscape or Portrait. It should be grabbing the x,y offset that was set when the banner was created.

    Can you confirm if this is the case?

    Thanks. Everything else works great with the plugin. I'm enjoying the new offset feature and the many different banner sizes.
  47. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @corey, I'll give that a look in the beginning of next year :)
  48. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    I see what you did there...
  49. prime31

    prime31

    Member

    Joined:
    Oct 9, 2008
    Messages:
    6,422
    @corey, I couldn't start the new year off with a nasty bug like that. Grab the latest package for a fix. I'll get an official email out sometime tomorrow.

    Happy New Year!
  50. corey.stpierre

    corey.stpierre

    New Member

    Joined:
    Nov 18, 2008
    Messages:
    79
    Prime thanks so much for that quick update! Works great.

    Happy New Year to you too.