Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    @Prime31 Is it possible something wrong in the MiniJSON parser?

    You can see the error message seems it was dead in the decoding process:

    Code (csharp):
    1. 2011-10-04 06:22:09.034 airafro[1570:707] -[__NSArrayM JSONString]: unrecognized selector sent to instance 0x1137ef0
    2. 2011-10-04 06:22:09.063 airafro[1570:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM JSONString]: unrecognized selector sent to instance 0x1137ef0'
    Now I have to sleep and can't work any more. :(

    Because it crash every time when it is launching.

    I could not find any solution to delete iCloud data in Apple's release note, either.

    It can go back to normally launch, but I have to remark all of "#define iCloud" in my scripts to recover them back to PlayerPrefs things.

    Since the iCloud feature is the last thing of my update this time, so all I can do is waiting for your new update. :)

    Hope I can get the new iCloud plugin update before this . ;)
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, quick fix: in the iClouldManager.mm file change the lines (around line 80) to:

    Code (csharp):
    1. NSLog( @"changed keys: %@", changedKeys );
    2. if( changedKeys  [changedKeys isKindOfClass:[NSArray class]]  changedKeys.count > 0 )
    3. {
    4.     if( [changedKeys respondsToSelector:@selector(JSONString)] )
    5.         UnitySendMessage( "iCloudManager", "keyValueStoreDidChange", [[changedKeys JSONString] UTF8String] );
    6. }
     
  3. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Well.... it works. :)

    My game stop to crash and retrieve data back normally. (Game could even continue after delete and re-install.)

    But, something seems still strange. Such as, the synchronize() could not work fine in OnApplicationQuit(), it would cache the older data, don't know why. Maybe it's my own bugs.

    Hope the formal update will be released soon. :)
     
    Last edited: Oct 4, 2011
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, formal update will be up in 10 minutes. Remember though that iCloud itself is still beta so there are some hiccups on Apple's side every so often.
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    at the time icloud and mobileme are in permaflux. mobileme had some probs for days now

    With the apple event in 16h 20m and the switch to icloud in the next weeks at latest, I would use this chance to also implement the fallback mechanisms. You will hopefully never get to see icloud in such a trash state as its right now ;)
     
  6. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    I've found even if the synchronize() return "true", data is not really synchronized sometimes. :(

    Is there anything I should know? Such as, Do I have to wait the keyValueStoreDidChangeEvent() been triggered?

    [EDITED: Usually, it don't work when just installed, the event will be triggered on the second run, and the data will be correct at that time.]
     
    Last edited: Oct 4, 2011
  7. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, synchronize does not do it on the spot. It just marks the data to be synchronized the next time iOS updates iCloud data.
     
  8. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Okay~~ (I knew it !!!!)

    So I can't force the iOS update manually, right?

    Do you mean iOS will synchronize iCloud data automatically even if the user had exited the app ? :D

    Wating for your new update....
     
    Last edited: Oct 4, 2011
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, there is no way to force iCloud to synchronize. It can happen when your app is opened or closed. The details are up to iOS.
     
  10. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Mmmm..... I hope the iOS could do this thing more stably. :(

    I'd like to use iCloud because I thought it can keep some important data of my game, such as accumulative total score, money earned, and players can continue their saved games on anyone of their devices.

    But the rule it operating seems not really precisely for such purpose.

    For example, I can not sure if the iCloud synchronize the data every time when my app is opened or closed, sometimes it synchronize, sometimes nothing happened at the moment when my app is opened or closed.

    Is there any dependable event could trigger me when the exact moment the iCloud checked the data and decide to synchronize or not ?

    As I known, this event "keyValueStoreDidChangeEvent()" just be triggered when something changed, right?

    Can you create another event like "StoreDidCheckedEvent()" for telling app the iCloud just had the data checked?

    At least, within the new event I can pop up an dialog to make player wait for synchronizing when he just re-install the app or open it on another device.

    Thank you.
     
    Last edited: Oct 4, 2011
  11. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    H, Prime31,

    Have you any plan to add a "Data Change Reason" event for iCloud plugin?
     
  12. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Hi, Prime31,

    It happened about 15 / 20 times of testing, the synchronize() won't go normally at the first time app was installed and launched, but really synchronized and "Did Change" event triggered after quit at first time launched, re-launched 2nd time.

    Is that normal ?
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, you have no control and no notification when iCloud syncs. Your app may or may not be open. The user may or may not have Internet access. It all just happens. Put a bug report in with Apple to let them know you want it. That is the only way it will ever happen. Remember also that iCloud is beta so it has hiccups.
     
  14. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Hi, Prime31,

    It seems a bug, I found this event keyValueStoreDidChangeEvent() never trigger in Unity3D, but only works in native Objective-c in XCode.
    (Unity3D did not receive the message sent from iCloud plugin.)
     
  15. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, make sure you are up to date with the iOS 5 GM and the latest version of the plugin. Be sure to delete all the old files before importing it.
     
  16. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Hi, Prime31,

    I am trying what you told me now.

    Last night I had installed XCode iOS 5 GM Seed, built my app, but when I submitted it to itunes connect, it told me:

    "Your app contains non-public API usage. Please review the errors, correct them, an resubmit your application."

    You can see them in the attachments picture.

    Is this problem caused by myself? or it could be solved by what steps you mentioned me?

    [EDITED] It's weird, XCode said it is no problem when I re-build it today, but I have not modified anything.

    About the event trigger, what I meant is the code didn't works fine:
    Code (csharp):
    1.     void OnEnable()
    2.     {
    3.         // Listen to all events for illustration purposes
    4.         iCloudManager.keyValueStoreDidChangeEvent += keyValueStoreDidChangeEvent;
    5.     }
    6.  
    I'd tested the object, and had been sure the object is alive in game all the time. But no Unity3D event triggered [ keyValueStoreDidChangeEvent( string param) won't be called ] when I saw some debug messages output by iCloud plugin native code.
     

    Attached Files:

    Last edited: Oct 5, 2011
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, there is currently a big with Apples validation. All apps are being rejected for private API usage even if they do not have any. Check the devforums an you will see a TON of the same rejection all showing public classes in the rejection.
     
  18. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    But not my debug message in the Unity3D event which should be triggered. :(

    Hi, Prime31,

    I've tried your step, but it doesn't work.

    I saw the message in XCode window:
    Code (csharp):
    1.  
    2. 2011-10-05 14:16:32.162 airafro[1469:707] keyValueStoreDidChange
    3. 2011-10-05 14:16:32.163 airafro[1469:707] changed keys: (
    4.     TotalScore,
    5.     bAfroBarCouldMove,
    6.     MusicVolume,
    7.     bPracticeMode,
    8.     IsGameStill,
    9.     bHardAvailable,
    10.     askRateGamePlayedTime,
    11.     GameLevel,
    12.     bLeftHander,
    13.     bJustHeartEvent,
    14.     bJustLevelUp,
    15.     FallSpeed,
    16.     bInsaneAvailable,
    17.     AfroBarPosZ,
    18.     SoundVolume,
    19.     AfroTypeOnBar,
    20.     bNotFisrtInstall,
    21.     AfroBarLevelCount,
    22.     Score,
    23.     AfroBarTargetCol,
    24.     AfroTypeOnNext,
    25.     NextBulletHeart,
    26.     AfroBarPosY,
    27.     HeartCount,
    28.     GameStartLevel,
    29.     AfroBarPosX,
    30.     AfroBarCol,
    31.     MonsterLifeInSlots,
    32.     xSpeed,
    33.     bColumnPreview,
    34.     AfroBarMagicCount,
    35.     AfroBarRow,
    36.     bNewGameFullMode,
    37.     OneAfroScore,
    38.     MatchOneAfroScore,
    39.     NextMissileHeart,
    40.     MatchScore,
    41.     bFullMode,
    42.     GamePlayedTime,
    43.     bNotFisrtGame,
    44.     Version,
    45.     AfroTypeInSlots,
    46.     bFacebookLogin,
    47.     bAfroBarCouldRotate
    48. )
    49. 2011-10-05 14:16:32.165 airafro[1469:707] for some reason, changedKeys is not responding to the JSONString message
    But these is no my own Debug.Log() message in Unity3D event which should be triggered. :(
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, you hit the magical debug line that should never be hit. Send me an email offline and I will give you a line of code to replace the JSONString message. For some reason categories are not loading on your build.
     
  20. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    I've emailed you through email (to Mike Desaro) and private message here. :D

    Can't wait to get your new update.
     
  21. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Hi, Prime31,

    I have tested your new codes and reply you email.
     
  22. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Heya,

    I am prepping for deployment. So, I made a new bundleidentifier and build to a new directory, and opened it in XCode. It built before, but now I can't get it to build anymore. I'm getting these old, stupid errors:

    'mono_dl_register_symbol' was not declared in this scope ... on the line with "etceteraGetCurrentLanguage" in RegisterMonoModules.cpp.

    I know I must have done something dumb because it worked 20 minutes ago with the old XCode project but now I can't fix it. What did I miss? I have XCode 4.0.1, I am building to 'ios latest' and 'ios 4.3' using Unity 3.4.0f5. I have the etcetera plugins and also the google analytics and maybe something else of yours. Plus, I have EZGui and Vectrosity, but I don't think that matters.

    Please help!

    Gigiwoo.
     
  23. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Gigiwoo, that error usually shows up when you have your scheme set to build for the simulator or the post process build scripts didnt run. Do you see the Etcetera folder in the Xcode project? Did you close Xcode before building?
     
  24. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Hah! That was it! I'm such a dunce. The new project reordered the scheme's for some reason, so even though I intentionally picked the scheme, I didn't actually read it closely!

    One question - can I start the prompt window from a yield co-routine? And, will it allow unity to keep going?

    Thank you,
    Curtiss
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gigiwoo, during the prompts display the Unity VM is frozen. It doesn't return an IEnumerator so you can't yield it though if you want to run some code right after it is done either use the events or just call a method after a .2 second delay. Regardless of if it is 1 second or 2 minutes later that will run when the prompt is dismissed.
     
  26. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @donlien, that was quick! Nicely done!
     
  28. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    I guess Apple hope the app which support iOS 5 its features on the app store quickly, too. :D
     
  29. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
  30. ravinder

    ravinder

    Joined:
    Aug 25, 2010
    Posts:
    150
    Guys any success how to remove this error from X Code 4.0 on snow leopard?
    I have got sick of this error and it is causing me delays to upload my binary.

    I was able to remove this error previously but don't know how, I just removed multiple instances of Core Graphics framework which was imported twice in my build but now it isn't working for me.

    Please help me!!!
     
  31. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Just got the media player plugin :)

    Having some issues -- I'm just testing a skip to next track button with useApplicationMusicPlayer set to false. It works maybe once or twice but then it'll kill the music. Memory issue? sfx still play

    edit: hold on might have found why -- seems useApplicationMusicPlayer() resets something

    edit2: yeah, when testing stuff I was using useApplicationMusicPlayer() before each attempt to skip to next track and it didn't like that.
     
    Last edited: Oct 8, 2011
  32. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @JTown, I can't reproduce. What do you see in the Xcode GDB log?
     
  33. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I was just playing around with the plugin and had something like this triggered by a button tap:
    Code (csharp):
    1. MediaPlayerBinding.useApplicationMusicPlayer(false);
    2. if(MediaPlayerBinding.isPlaying()){
    3.     MediaPlayerBinding.skipToNextItem();
    4. }
    5. else{
    6.     MediaPlayerBinding.showMediaPicker();
    7. }
    Moving MediaPlayerBinding.useApplicationMusicPlayer(false) to Start() fixed it. I think it was also making MediaPlayerBinding.isPlaying() report incorrectly, because I also tested useApplicationMusicPlayer(true) and it would always open up the media picker instead of advancing to the next track (which is what first clued me into MediaPlayerBinding.useApplicationMusicPlayer() being the problem).

    But everything's working as expected now :)

    edit: Didn't see anything stand out in GDB log, but I can try to reproduce if you want. I assume I was just using MediaPlayerBinding.useApplicationMusicPlayer() in a way that was unintended (seems like it needs a bit of time to finish doing what it does) -- I was just being lazy while initially poking around in the plugin.
     
    Last edited: Oct 8, 2011
  34. MysteryGuest

    MysteryGuest

    Joined:
    Sep 20, 2011
    Posts:
    10
    @Prime31:
    Is it possible to integrate FQL requests in the next version of the SocialNetworking plugins (iOS + Android).
    Or am I missing something in the current plugins?
    Because I'm desperate for some better sorting / paging / searching functionality.
    Please don't take this the wrong way, but the regular GRAPH requests just don't offer the flexibility I'm looking for.
    Still.. Keep up the good work! I don't even wanna think about what to do without these great plugins.
     
  35. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Quickie... When I run my app in XCode, I get a bunch of messages sort of like the below. Are these perchance coming from anything in one of the Prime 31 plugins? Or is it from another plugin I use? I use etcetera, native toolkit, and google analytics of yours (also EZGui and vectrosity).

    Code (csharp):
    1. A script behaviour has a different serialization layout when loading. (Read 72 bytes but expected 76 bytes)
    2. Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    3.  
    4. (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Serialize/SerializedFile.cpp Line: 812)
    Gigiwoo.
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Mystery, rest calls are already supported on both platforms. I believe the demo scene even has a FQL example.

    @gigi, that is most definitely not coming from a plugin. No manual serialization is ever done.
     
  37. MysteryGuest

    MysteryGuest

    Joined:
    Sep 20, 2011
    Posts:
    10
    @Prime31:

    Thnx for the reply, but I can't find the REST API support in the Android plugin. There's no function which suggests it's implemented in the 'FacebookAndroid.cs' file. Please correct me if I'm wrong...
    You were right about the example in the demo though, so that's really great news!! But, as stated, this only works for the iOS version. Could you PLEASE tell me how to get the same functionality within the Android plugin, because I really need my app to have the same functionality on both platforms...
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Mystery, from the documentation:
     
  39. MysteryGuest

    MysteryGuest

    Joined:
    Sep 20, 2011
    Posts:
    10
    @Prime31

    I appreciate your reply, and I started to wonder why I couldn't find your method, since it's even in the documentation ...
    I found out it's all about one of your updates I had missed. My plugin version was from 2011-09-14 and had no such method in it... Now that I updated to the 20-11-09-22 version, I finally found it. I'm sorry for bothering you about it.
    Thank you for the help though, you're my hero :)
     
  40. pretender

    pretender

    Joined:
    Mar 6, 2010
    Posts:
    862
    hi, i have a question for prime31...is there a solution for ads within web player?
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pretender, we currently don't have any plans to make a webplayer ad banner system at this time.
     
  42. oliverdb

    oliverdb

    Joined:
    Jan 30, 2010
    Posts:
    165
    Hey Prime

    Thankyou for your pluging, I finally managed to get something through and got the following error. What does it mean?


    Code (csharp):
    1.  
     
    Last edited: Oct 12, 2011
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @oliver, looks like you are successfully purchasing but then the receipt validation is failing. Are you properly setting the isTest flag when validating in the sandbox? Do you really need to be validating? Generally, validation to be unhackable requires it to occur on a separate device (your own external server)?
     
  44. oliverdb

    oliverdb

    Joined:
    Jan 30, 2010
    Posts:
    165
    I know what I though that validating the receipt was an requirement? Its a Non-consumeable, but I dont need todo it.

     
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @olliver, validating the receipt is most definitely not a requirement. It is just an anti-hack method but when done on the device itself it is still hackable vs doing it on a server.
     
  46. aarora2

    aarora2

    Joined:
    Aug 2, 2011
    Posts:
    11
    Hello to all,

    I am using NativeToolKit plugin. i want to send some data from unity scene like state of an object(position,angle) etc to save it in the plist so that when i go from one scene to another and then back to 1st scene then state of object remain same(position,angle) which can be set by reading the values from plist or set the same position or angle when loading the 1st scene. Can someone suggest me?

    Thanks,
    anki
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @anki, you can just save directly to disk or use PlayerPrefs to save any data you want.
     
  48. legion

    legion

    Joined:
    Feb 9, 2011
    Posts:
    174
    Is there any update to the flurry plugin comming soon? So it supports clips on iOS?
     
  49. AdeS

    AdeS

    Joined:
    Mar 22, 2011
    Posts:
    3
    Hi,

    Is anyone else experiencing problems with this ?

    On iOS5 devices I'm seeing a lot of GLES errors and the camera output either doesn't work or is going so slowly (maybe one frame every 5 seconds) it appears not to work. The same build works fine on iOS 4.3.x devices.

    My build environment is the latest everything (Lion 10.7.2, Xcode 4.2, Unity 3.4.1, iOS5 SDK)

    Ade
     
  50. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Legion, I am having a hard time communicating with Flurry at the moment to get the necessary info. Clips is actually a totally different SDK than App Circle and tracking so if we ever sort things out with Flurry it will probably make its way into a cheap, separate plugin.
     
Thread Status:
Not open for further replies.