Search Unity

Prime31 Unity Plugins Officially Live! [CLOSED]

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

Thread Status:
Not open for further replies.
  1. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nshack, you posted the output of an Android build. This is the iOS forum. Please post in the appropriate forum.
     
  2. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hi,

    I've looked the last messages from this topic and can't see anyone talking about the last WWDC (june 2012).
    Apple announced a deep integration with Facebook (just as they did with Twitter). Are you planning to update your Facebook plugins to add these functionalities ?

    Thanks.
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nah0y, we always update our plugins to support the latest features of new iOS versions. As of now, iOS 6 is in beta 1 so we have absolutely no plans to start "chasing betas" this early in the cycle with releases. Once iOS 6 gets closer to release and solidifies we will start pushing out updates.
     
  4. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Yes of course, no rush :)

    Thanks for the awesomeness !
     
  5. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Am I correct in thinking that with your MediaPlayer plugin, the option to copy a music library track to the document folder is not presently working for all formats of music? It looks like you are just passing through the audio rather than re-encoding to a different format, and whilst this might work for mp3s, users are quite likely to have music in a different format that will fail. I have been able to work around this by rewriting the export chunk of the plugin so that it creates a .wav file (iOS lacks mp3 encoder) instead, which Unity can then load at runtime using WWW. The only tracks this won't work with are DRM'd ones, which isn't so much of an issue these days.

    Anyway I found several threads where people wanted to do this sort of thing in order to do analysis of music data within unity, so I thought I would ask whether you might consider adding this modification yourself, and also to check that I was correct that the present implementation isn't really up to scratch in this regard.

    Cheers for the plugin anyway, Im new to Objective-C so you saved me a lot of time by providing the foundations, worth every penny.
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @elbows, the latest version of the plugin has wav export of non-DRMd tracks but care must be taken. Files and memory sizes can be enormous and Unity can only play a narrow subset of wav formats.
     
  7. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Thanks. When you say latest version, is this version available yet? I only purchased a few days ago and that functionality wasn't present in the version I downloaded.

    Agree that file sizes are an issue, its a shame Unity doesn't support more formats for runtime loading.

    Alternative approach would be to still have the music played by iOS MediaPlayer, but use iOS vDSP to do realtime FFT and then pass the results to Unity as floats. But this is far more work in some senses, and I don't know how much advantage it has in terms of memory use since examples I've seen still involve converting the music to a LinearPCM format first, even though it doesn't need to be saved to storage. And I don't know how efficiently lots of floats can be passed between native plugin and Unity continuously in realtime.
     
    Last edited: Jun 25, 2012
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @elbows, we will be pushing out the update shortly
     
  9. YourUncleBob

    YourUncleBob

    Joined:
    Jun 11, 2012
    Posts:
    55
    I've been looking over the iOS StoreKit plugin docs and don't see how it handles the payment queue (either queued transactions or calling finishTransaction).

    Based on the Apple docs, I thought I'd need to follow a flow along the lines of:

    • register handlers for interrupted purchases
    • get product data
    • purchase a product
    • validate the receipt, preferably on a server not client
    • register the purchase with the game (unlock the content or increase the token count or tell our server about it or save it in userprefs or whatever)
    • flag the transaction as finished

    The interface that the plugin provides seems too simple to handle interrupted transactions. Am I missing something?

    Does the plugin implement a payment queue transaction observer?

    If it does, does this mean I can get purchaseSuccessful events fired off as soon as the plugin is initialized (if there's an interrupted transaction sitting in the queue)?

    When is the plugin marking a transaction as finished?
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @youruncle, the plugin finishes transactions and saves the data for you just before the purchaseSuccessful event fires.
     
  11. YourUncleBob

    YourUncleBob

    Joined:
    Jun 11, 2012
    Posts:
    55
    Got it, so it's saving a local record of every transaction before flagging it as finished. I was thinking that I needed to do all of my validation and registration before the finish was called, but the saved file serves that purpose.

    What I'm trying to implement with this system right now are consumables. I want to make sure and register every purchase with our server one time.

    Is there a way to delete a transaction after I process it so that it doesn't show up in future calls to getAllSavedTransactions()? If so, I guess I could do:
    • Register with our server in the purchase complete callback
    • If successful, delete the transaction
    • When the game starts up
    • ____Call getAllSavedTransactions
    • ____Register each transaction with the server
    • ____Delete each transaction from the list after processing it

    Would you recommend something different?
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @youruncle, getAllSavedTransactions gets all transactions. There is no way to remove any from it. You can of course keep a local store of your purchased products which you should be doing anyway.
     
  13. YourUncleBob

    YourUncleBob

    Joined:
    Jun 11, 2012
    Posts:
    55
    Will do, thanks. We will be keeping track of all of our purchase records server-side. I was just looking for a cheap way to not have to compare two ever growing lists (with any luck they'll be ever growing) when all I'm trying to find are the entries that haven't been registered with the server yet (we currently have a pretty limited server).
     
  14. Cookies

    Cookies

    Joined:
    Mar 6, 2012
    Posts:
    19
    Hi,

    I have bought the Prime31 Social Networking package.

    When I imported it to Unity, it gave me these errors:
    Assets/Plugins/SocialNetworking/FacebookCommon/Facebook.cs(5,7): error CS0246: The type or namespace name `Prime31' could not be found. Are you missing a using directive or an assembly reference?

    Assets/Plugins/SocialNetworking/testSupportIOS/SocialNetworkingGUIManagerTwo.cs(6,7): error CS0246: The type or namespace name `Prime31' could not be found. Are you missing a using directive or an assembly reference?
    These errors take me to scripts Facebook.cs and SocialNetworkingGUIManagerTwo.cs

    They both point to this line of code:
    using Prime31;

    Is there something I am missing? :(

    Thank you
     
  15. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @cookies, it sounds like you are missing the P31RestKit.dll file. Redownload the plugin unitypackage and reimport it into your project making sure the file is there and that it is checked.
     
  16. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hi Prime31,

    I'm trying to implement the Open Graph 2.0 API from Facebook, and reading the doc, they say we must call things like :
    [facebook requestWithGraphPath:mad:"me" andDelegate:self];

    So, I checked on your iOS source files, and in the FacebookBinding.m, I can see the method _facebookGraphRequest that calls :
    [[FacebookManager sharedManager] requestWithGraphPath...

    So we have the methods, BUT, it seems nowhere to be found on the CSharp side on Unity.
    In the FacebookBinding.cs, we have the method _facebookRestRequest, called by restRequest, but there is no _facebookGraphRequest called.

    Is this something you forgot ?
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nahoy, Facebook.imstance.graphRequest is most likely what you are looking for.
     
  18. BazLevelUp

    BazLevelUp

    Joined:
    Jun 27, 2012
    Posts:
    36
    Hello !

    We're using some plugins of yours in our project and we're happy :)

    But we're also using plugin of other people and they have not made any PostProcessBuildPlayer stuff, so we have to include frameworks and change Xcode Build options by hand every time we make a built :(
    Off course, this is horrible and it makes us all being real sad pandas, so we decide to make a script that would do it automatically. I think I have managed to get something decent BUT my script won't ever get executed.

    I have tried naming it properly PostprocessBuildPlayer_OthersPlugins as written in your script :
    Code (csharp):
    1.  
    2. [...]
    3. # Searches for other PostprocessBuildPlayer scripts and executes them. Make sure the other script
    4. # have a name suffix with an underscore "_" like "PostprocessBuildPlayer_AnotherBuild" or whatever.
    5. [...] (functions that do what described above)
    6.  
    and your script kinda detect there's something (here in console) :
    Code (csharp):
    1.  
    2. 28/6/12 3:55:39.519 PM Prime31: Processing all folders
    3. 28/6/12 3:55:39.522 PM Prime31: file has postprocess in it: OthersPlugins
    4. 28/6/12 3:55:39.523 PM Prime31: --- About to kick off the Runner for Localytics ---
    5. [...]
    6.  
    but nothing happens :(

    I have tried renamed my script jus "PostprocessBuildPlayer" and get rid of yours, and no PostProcess :(
    So I'm guessing there's something special you're doing to get your script executed.
    Can you please tell me ?

    I have created a topic about it so if you didn't get what I meant here, feel free to have a look there.

    Thank you in advance for your time !! :)


    EDIT : I just realized that my Postprocessbuildplayer didn't had all the rights in my system so I set it to "Read Write" for everyone. Didn't help :(
     
    Last edited: Jun 28, 2012
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @baz, there is no magic involved. Simply naming the file PostProcessBuildPlayer_Something will most definitely get the script called.
     
  20. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hum, yes BUT this is just a GET request, why don't you use the methods that is said should be used in the documentation ?
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nahoy, if you look at their source code it's just a GET or POST request.
     
  22. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hum okay thanks.

    As long as it gets the job done :)
     
  23. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Hi !

    Another question,

    After successfully made a facebook login, is Facebook sending back the user id ? That would be great, because right now we need to make another request to the graph api after login to get it...

    Thanks
     
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nahoy, Facebook returns no information about the user after login. You have to request any data you need from them using the Graph API.
     
  25. nah0y

    nah0y

    Joined:
    Apr 4, 2011
    Posts:
    74
    Okay thanks for the answer,

    That's kind of... strange... I mean, they could at least send you the user ID since you would likely need it. But never mind...
     
  26. Cookies

    Cookies

    Joined:
    Mar 6, 2012
    Posts:
    19
    Hello,

    I am having trouble with the Game Center plugin
    I can get the achievement screen to pop up but I cannot get the achievements to complete. So it always says 0 out of 3
    I am using this function GameCenterBinding.reportAchievement( name, percent );
    But maybe I am putting the wrong "name" in?

    Say I have an ID of ACHIEVMENT_5_STARS
    I tried putting in GameCenterBinding.reportAchievement( "ACHIEVMENT_5_STARS", 100 ); and that didn't work
    I tried GameCenterBinding.reportAchievement( "companyname.gamename.ACHIEVMENT_5_STARS", 100 ); and that didn't work

    Is there a certain format I need for name or could I be doing something else wrong?
     
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @cookies, look back in this thread for countless posts on achievements/scores not showing up in the sandbox. The topic comes up very often and it is totally normal.
     
  28. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    I just bought the iCloud plugin and I have a question about turning it on and off.

    I want to give the player the option to use it or not, so I have a popup box that asks the question the first time the player runs the game. I was going to have the manager gameobject off and if the player turns iCloud on, then the manager GO will turn on. But I'm not sure this is the best way. Will all of the saved data use the player prefs if the manager is off?

    Thanks,

    JL
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @crazy, just use PlayerPrefs directly if you don't want to use iCloud. Disabling the manager script won't do anything at all.
     
  30. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Ok, thanks,

    Also,

    Does it sync every time a value changes or just on start up and shutdown?
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @crazy, per Apples docs syncing is handled whenever iOS feels it should occur. There are no set times.
     
  32. Deoxyz

    Deoxyz

    Joined:
    Dec 13, 2009
    Posts:
    38
    Hi

    Where can i find the Unity Android Large APK Downloader Plugin?
     
  33. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    Quick question on restore transactions. WHere's the best place in the eventHandler to popup a message on fail restore? Aka a user tries to do a restore but they haven't purchased or whatnot? THats one i've never gotten quite right so i've always skipped it and just let the app not respond at all.. really not a very good way to handle that. :)
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @deoxyz, this is the iOS forum so please try to stay on topic. The APK Downloader Plugin is not available at this time.


    @bpritchard, where ever your restore button is located is a good place to add the event listener and let the user know you were not able to restore anything.
     
  35. Deoxyz

    Deoxyz

    Joined:
    Dec 13, 2009
    Posts:
    38
    Sorry, didn't see that from google. I only saw the title.
    Next time I'll pay more attention. :)
     
  36. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @Prime31


    Heya Prime, thx for the info but thats not quite what i was looking for. The event system works correctly.. and i am able to do the reactivations and such but i'm trying to figure out which even is triggered when the reactivation fails.
     
  37. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, the aptly named restoreTransactionsFailed event fires when restoring transactions fails.
     
  38. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime, ahh well ok. I guess that makes sense... thanks prime!
     
  39. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @Prime31

    ok this is the issue i keep having w/the failed restored transactions. So i have it setup to a button (and the event listeners are in the scene and working) to start the restore transaction function. All works, brings up the user password confirmation and such and IF I hit cancel on that i get to the restoreTransactionsFailed... but if i input the proper password and let it finish processing.. it doesn't do anything (this is from a user who has never bought it.. real restores work fine). But what i get in Xcode logging are these 2 messages...

    paymentQueueRestoreCompletedTransactionsFinished
    restoreTransactionsFinished

    so i guess in that instance.. how do i handle a message that states No previous transactions if the user never bought it but its not returning failed?
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, if there are no transactions to restore than the product purchased event won't fire. That is the expected behavior. It isn't a failure to restore transactions, it is successfully restoring none.
     
  41. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime31

    Right.. but, unfortunately the customer is requesting that we indicate to the user that there were no previous transactions... is there anyway to read or get to the data at a level that we can determine that? Or are we just "sol" so to speak on that?
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, that isn't really how Apples API works but I suppose you can fake it. If no product purchased events fire for x seconds than you can assume there are no transactions to restore.
     
  43. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @prime

    Interesting.. i never really thought about it that way. :) I'll give that a whirl and see what i can come up with.
    thanks!
     
  44. Radiangames

    Radiangames

    Joined:
    Sep 15, 2011
    Posts:
    16
    I'm having frequent problems with the iCloud plug-in where it doesn't seem to work (though it does sometimes). When I start the game through XCode, I'll see this pair of messages:

    slydris[8557:5e03] doc class IS available...
    slydris[8557:5e03] found it. checking cloudDir: (null)

    I don't know if the problem is Apple's or the plugins or mine.

    Debugging iCloud issues seems very difficult, so if you have any suggestions or ideas for how to make my iCloud implementation more robust, please let me know.

    I already have two different save systems (iCloud and local only), and merge the two automatically (take the greater of the two systems' values for relevant stats). But it seems like iCloud works less now than when I first started using the plug-in, and it's very difficult to know why.

    Thanks,
    Luke
    Radiangames

    PS. If there's an easy way to see recent changes for a plug-in, that would be helpful too. I don't want to download new versions unless I know there's a good reason to. I don't even know if there's a new version unless I re-download them and check the dates.
     
    Last edited: Jul 6, 2012
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @radian, you can always view plugin updates and release notes here: http://prime31.com/unity/pluginUpdates/ Just to be certain that you are aware, iCloud will not work properly on jailbroken devices. A null log indicates that the document store is not available. That is most likely due to either your entitlements not being setup properly in Xcode or your provisioning profile not being setup properly. Refer to Apple documentation for how to set them up.
     
  46. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @Prime31

    Heya Prime.. another store kit q. I think we're using the event listeners wrong but apparently if the user attempts to restore purchases and successfully does so.. the device will constantly ask for the password on the account every time the machine comes back from sleep. I don't have anything tied to the retrieve function in on enable anywhere.. and the event listeners aren't set to persist. Is thing anything you've seen before? I can almost guarantee its something we've setup wrong.
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, I can't say I have ever seen the password prompt come up more than once. I would suggest that you ensure that you are calling restore transactions only once and never again. That call is the one that triggers the prompt.
     
  48. Gamesmold

    Gamesmold

    Joined:
    Sep 6, 2011
    Posts:
    74
    Hi Prime31,

    I just bought your iCloud plugin and just don't get it to work (the app behaves as if the Prefs31 class just isn't there).
    Calling Prefs31 doesn't even save/read normal PlayerPrefs.

    In the Xcode project, there is an iCloud folder, but it is empty. Do I have to 'replace' the Xcode project (when exporting from Unity) to get iCloud integrated? I'd like to keep 'appending' the project, cause I already did many changes to it in Xcode.

    Thank you,
    Thomas
     
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @games, doing append builds is fine. Have you properly setup your app in the Apple provisioning portal for iCloud? See their documentation for more information of you don't know how. Also, if you test on a jailbroken device iCloud will fail.
     
  50. serioustommy

    serioustommy

    Joined:
    Jun 12, 2012
    Posts:
    126
    Hi,

    Regarding iCloud, is there anything exposed in your API to handle conflict resolution? I've taken a quick look on the doc on your website but can't see any. I suppose this is going to cause an issue if the game is played on 2 devices and both are synced together?

    thanks,
    Tommy
     
Thread Status:
Not open for further replies.