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

    spintrinsic

    Joined:
    Mar 19, 2010
    Posts:
    3
    Prime - first, a big thanks for your contributions to the community, (and all of your solo tech support!) I just bought your iAd plugin, and it seemed to integrate fine, but I get the following compiler errors in xCode (AdManager.mm):

    'ADBannerContentSizeIdentifierLandscape' was not declared in this scope and
    'ADBannerContentSizeIdentifierPortrait' was not declared in this scope

    Before building with the new plugin, I cleaned all targets in my xCode proj and closed xCode. I've also checked that the iAd framework is in my xCode project. I'm completely out of ideas. I can't wait to get this working.
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @spintrinsic, that is an easy one. Just set your Base SDK to 4.2 and the error will go away.
     
  3. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    Hi again Prime31,

    Thank you for your latest answer (eventListeners).
    That reply made me feel all of a sudden "very lonely" in the developer world , as you understood I never used event listeners in Unity. ;)

    I had better results then.

    I know you asked about our opinion months ago (you asked if your plugin needed more tutorials, etc) and that you may have done a lot since, but I believe, though, that your plugins deserve more comprehensive thorough examples.
    That is, a bigger example with realistic, more intricate situations. Like multiplugin usage in the code.
    Or a FAQ with all the situations we had here.

    I have a problem here which doesn't occur with the test applications.

    I launch an alert (a two buttons alert).
    I catch its result with an alert listener ( EtceteraManager.alertButtonClicked += alerteCallbackFB1; )
    If I click on OK on this button, I change a flag variable ( alertIsOK = 1 if we click on Yes, for instance).
    This simple part now works.

    If I catch this status in the variable, in the OnGUI code I :

    1. first try to remove the alert listener with:
    EtceteraManager.alertButtonClicked -= alerteCallbackFB1;
    .. this one throws a warning in Unity (asks for another method reference).
    So, the code works one way (adding the event) but not the other (removing it) in Javascript.
    In my further attempts I tried with or without this line.

    2. launch a FacebookBinding.login().
    This seems to launch.
    However, the web view pops in (Connect to Facebook) then immediately disappears.
    My GUI screen (which should have been hidden by the web view) is displayed but nothing then answers user input. My application status is unchanged.
    The iPhone application looks as if crashed, whereas it is not.


    Please tell me if you ever encountered one such situations (when launching FacebookBinding.login(), it pops in and immediately disappears) or if you have a clue about this.

    I thought that something in my code was the problem so I removed everything out
    I spent hours making attempts, hope you'll come up with a magic solution to this :)


    EDIT :
    I got it working by removing the launch for the alert with two buttons.
    Now that I don't have any alert launched, and no active event listener at all, I can execute the Facebook.login() with no problem.
    I really believe there is something odd with the listeners.

    I have another simple question, which isn't 100 percent related with the plugins, but since all of you should know the answer:

    To send push notifications, we need the iPhone device token. I want it from Unity of course, and it doesn't seem to be the iPhoneSettings.uniqueIdentifier, which is too short for it. I mean that Urban Airship doesn't accept this as a device token, it asks for a 64 length token.

    Do you know what parameter accesses the device token from Unity?
    And how to have the device token then registered on Urban airship, as the :

    EtceteraBinding.setUrbanAirshipCredentials( "...", "..." );
    EtceteraBinding.registerForRemoteNotifcations( RemoteNotificationType.Alert);
    ... didn't do the trick.
    Thanks a great lot.
     
    Last edited: Dec 9, 2010
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Removing event listeners with -= definitely works in JS. As for Facebook, don't show the login dialoging the user is already logged in. When they are logged in the dialog will open, realize they are logged in and then close. That is done by Facebook and not modifiable.
     
  5. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    Thank you for your reply.

    For the Facebook login screen which disappears, the FacebookBinding.isLoggedIn is tested before launching FacebookBinding.login().

    This is something else.
    I believe that I do not setup the event listeners correctly ; I need to cancel anything related to event listenings before I decide to do the FacebookBinding.login() to have it working. At least it worked.

    Please help me in finding what I am not doing right.
    I'll switch to a "dumb writing" mode to say exactly what I have, so that you could exactly say what doesn't work.

    Formerly you said :

    ... should work in JS. This doesn't work in JS as void someListenerFunction (result) cannot compile.
    I have to do this instead:


    Yes, I know, this one was silly. To show more details:

    1. In the OnGUI code, I have a button, when clicked, it launches a :

    EtceteraBinding.showAlertWithTitleMessageAndButtons( textFacebookQuestion1, commentFacebookQuestion1, "yes", "no" );
    EtceteraManager.alertButtonClicked += alertCallbackFB1;

    2. Somewhere else in my code :

    function alertCallbackFB1( alertText ) {
    if ((alertText == "Yes") {
    eventAlertOK = 1;

    } else if (alertText == "No") {
    currentStep = 13; // this moves to another code section
    // EtceteraManager.alertButtonClicked -= alerteRetourFB1("");
    };
    }

    3. And again in the active GUI code, I have a :

    if (eventAlertOK == 1) {
    EtceteraManager.alertButtonClicked -= alertCallbackFB1;

    /// this line raises a Warning in Unity : WARNING: Unsubscribing from event 'EtceteraManager.alertButtonClicked' with an adapted method reference. Either change the signature of the method to 'callable(String) as void' or use a cached reference of the correct type.

    if ( !FacebookBinding.isLoggedin() ) FacebookBinding.login();

    }

    What is wrong in this? Is there a return() or something to put inside the function?
     
    Last edited: Dec 9, 2010
  6. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    I made some progress on the Push thing.

    EDIT :
    The Push thing is now working. I was using my Urban Airship account credentials, instead of the APP Key + SECRET (and not master secret).
     
    Last edited: Dec 9, 2010
  7. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Aekar, for Urban Airship the plugin will handle sending UA all they need as long as you call setUrbanAirshipCredentials and registerForRemoteNotifcations on every launch. If you want to ensure things are working check the logs and also listen to the events: urbanAirshipRegistrationSucceeded and urbanAirshipRegistrationFailed.

    As for event listeners, it looks like you have everything correct there as long as no matter what you always remember to deregister when the game object is destroyed if you hadnt already. I get the popup then dismiss as well even sometimes when isLoggedin returns false. It could be a cookie Facebook stores through the webview they use.
     
  8. spintrinsic

    spintrinsic

    Joined:
    Mar 19, 2010
    Posts:
    3
    Wow. Kind of embarrassed that I missed that. Thanks! The ad banner shows up now! My latest issue is that the iAd banner disappears after loading a new scene, or reloading the current scene. I hope to be embarrassed again, because that would mean it's a really easy fix...
     
  9. Aekar

    Aekar

    Joined:
    Dec 3, 2010
    Posts:
    11
    Prime31,

    This might have been asked before, but can we set up local notifications using the Etcetera plugin?

    I hoped we could, but unless I'm mistaking it seems that we can only set remote notifications (via Urban Airship wonderful service).
     
    Last edited: Dec 10, 2010
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @spintrinsic, the ad banner shouldn't be affected at all by Unity scene loading. It is it's own UIView, 100% separate from Unity. The only way to get it to disappear is to call destroyAdBanner or if no ad is available. Check the Xcode logs while you are running it because Apple does send about 30 - 40% failed ads on purpose for testing.

    @aekar, the Etcetera Plugin only support remote notifications via your own server or Urban Airhip.
     
  11. nggs

    nggs

    Joined:
    Oct 23, 2009
    Posts:
    90
    I'm releasing my app this week, and I'm using Prime31's Storekit plugin (muchas gracias) but it appears that I can't submit in-app purchases with a first-time app, is this really true? I'll have to hide the store page, submit my app, WAIT for them to approve it, then submit an update and WAIT for them to approve that too?

    Wow Apple, way to make it difficult to make a buck :D

    I just wanted to post here to clarify these things I believe to be true. Anyone know differently?

    Tom
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @NGGS, what makes you think you cant have IAP in the first launch of an app? I have seen plenty of apps that launched with IAP.
     
  13. nggs

    nggs

    Joined:
    Oct 23, 2009
    Posts:
    90
    thanks for replying, and that's encouraging..

    I'm trying to follow your documentation at :http://www.prime31.com/unityDocs/#storeKitDoc
    and I get to this point:
    I'm trying to test my purchase but I get "cant connect to iTunes Store", I went digging and came to the (wrong??) conclusion that the above quote was my problem.
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @NGGS, an important piece of information that the Apple rep left out of that quote is that an approved binary does not necessarily have to be released to the App Store. That being said, I have IAP working on a test binary that never was sent for review. Follow the instructions very, very carefully making sure you have test users and that you are in the sandbox environment. Changes in the iTunes Connect portal often take 24 hours to propagate so prepare to be patient as well.
     
  15. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    Bought the MediaPlayer and I love however is there a way to turn on shuffle to a playlist you select. If not, how hard is it to add this feature? Thanks

    - Matt
     
  16. nggs

    nggs

    Joined:
    Oct 23, 2009
    Posts:
    90
    Ahh, well then this is most likely my problem. I assumed since it all showing in itunes connect that I was good to go, but I just got everything on there today.

    For sandbox mode, there's not a switch to flip or anything, right? I've signed out of my usual account in ios-> settings menu. Now as long as I run my app through xcode it will be in sandbox mode?

    Thanks for all your help.. I should point out that none of the issues I'm having are actually problems with the plugin, I'm just struggling with Apple. I'd integrated the plugin in minutes :)
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @mehware, a real quick fix is to change line 46 in the MediaPlayerManager.mm file to the following:

    Code (csharp):
    1. [_musicPlayer setShuffleMode:MPMusicShuffleModeSongs];
    @NGGS, setting up in app purchase stole many hours and took years off my life with the frustration. It sounds like you are doing everything correctly. Just always be sure to log out of the 'Store' section of Settings before testing your app.
     
  18. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @mehware, actually, I think you may have just turned yourself into a beta tester. Grab the latest version of the plugin and feel free to test out the new setRepeatAndShuffle method and let me know if it works (it is fully untested right now)
     
  19. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    I am going to do further testing so far it works the shuffle/repeat. For anyone who is interested in getting shuffle in their app check out these docs first, http://developer.apple.com/library/...oller_ClassReference/Reference/Reference.html

    for example.. I originally did MediaPlayerBinding.setRepeatAndShuffle(0, 1); (setting the 1 thinking it was a boolean true/false when in fact setting it to 1 is turning shuffle off. You need to do this,

    MediaPlayerBinding.setRepeatAndShuffle(0, 2); to get the MPMusicShuffleModeSongs setting for shuffle.

    So make sure you look at the above link to pass the right integers in.

    The only problem I have with the MediaPlayer plugin is when I get interrupted, or switch apps, phone call etc. and go back to the app the iPod Player doesn't resume. Is this something I can do on my end in unity or in xCode somewhere. Thanks

    - Matt
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @mehware, if you pass in the enums (defined on the top of the MediaPlayerBinding.cs file) instead of ints it gets a lot easier:

    Code (csharp):
    1. public enum MusicRepeatMode
    2. {
    3.     Default,
    4.     None,
    5.     One,
    6.     All
    7. }
    8.  
    9.  
    10. public enum MusicShuffleMode
    11. {
    12.     Default,
    13.     Off,
    14.     Songs,
    15.     Albums
    16. }
    As for iPod music not playing after an interruption, did you try calling play when focus returns to your game?
     
  21. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    Thanks Prime31.

    I do this to resume audio.

    function OnApplicationPause(pause : boolean)
    {
    if (pause == true)
    {
    Debug.Log("pause");
    MediaPlayerBinding.mediaPlayerPause();
    }

    if (pause == false)
    {
    Debug.Log("play");
    MediaPlayerBinding.mediaPlayerPlay();
    }
    }

    This will pause and then play the audio when the app relaunches from a background state however when the app resumes it goes to another song instead of resuming play on the current one. Here is my output from the editor.


    play

    (Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

    chose 55 songs

    (Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

    Error initializing AudioSession(errNO:1768843636)
    Error initializing AudioSession(errNO:1768843636)
    -> applicationDidResignActive()
    pause

    (Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

    -> applicationDidEnterBackground()
    -> applicationWillEnterForeground()
    -> applicationDidBecomeActive()
    Error initializing AudioSession(errNO:1768843636)
    play

    (Filename: /Applications/buildAgent/work/71ca6fec1b41cc30/Projects/../Runtime/Export/Generated/BaseClass.cpp Line: 2528)

    Error initializing AudioSession(errNO:1768843636)


    Maybe the AudioSession is destroyed when you "exit" the app and it goes in the background not sure. What do you think?

    - Matt
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @mehware, the session definitely appears to be killed and recreated. Perhaps hit the previous track right after calling play to get the original track will work.
     
  23. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    Sure, I'll do that for now, I hope previous track works with shuffle. Thanks for the quick fix.
     
  24. CapnJ

    CapnJ

    Joined:
    Aug 6, 2009
    Posts:
    29
    Having a hard time running your "CoreLocation" plug-in test scene on a device. Seems everything builds fine out of Unity (Including the plug-in verification). But when i try to Build and Run on my iPad (iOS4.2) i get a few warnings and an failure error:

    /Users/CapnJ/New Unity Project 9/1/Classes/AppController.mm:393:0 /Users/CapnJ/New Unity Project 9/1/Classes/AppController.mm:393: error: request for member 'scale' in 'mainScreen', which is of non-class type 'UIScreen*'

    As far as unity goes, i'm just trying to get your test scene to run on a device.

    Any thoughts?:confused:

    Thanks,
    Jason
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @CapnJ, your error is in the AppCibtroller which has nothing to do with the plugin code. I would suggest double checking your setup and ensuring your Base SDK is set to 4.2 as a start.
     
  26. CapnJ

    CapnJ

    Joined:
    Aug 6, 2009
    Posts:
    29
    Thanks for the quick reply! unfortunately...

    - Made new project
    - set up iOS publish settings
    - made new scene with cube on stage
    - published to iPad
    - works fine...

    - Imported plugin
    - quit xCode
    - did the Unity Build
    - after built, Attempted to "Build n' Run' in xCode
    - same errors, image attached, prolly has more info that you need

    Maybe a dumb question, but does iPad indeed have a compass?
     

    Attached Files:

  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @CapnJ, are you certain you are setting your Base SDK to 4.2? Your target build settings should look like this:
    Your error is still in the AppController.mm file which isn't part of the plugin. The method that is giving you an error (setContentScaleFactor:) is only available in iOS 4.x and greater.

    Some iPads have compasses some dont. The 3G model does have a compass and the plugin provides a method to see if it exists or not: CoreLocationBinding.isCompassAvailable If the compass is not available and you try to use it the plugin will fail gracefully because it checks to make sure it exists before using it.
     
  28. CapnJ

    CapnJ

    Joined:
    Aug 6, 2009
    Posts:
    29
    Ah. Must be the iPad i have for testing. Its just a wireless so no 3G = no compass. Boo. I DO happen to have an Droid 2 which does have a compass. Any idea as to making a droid plug-in?

    Thanks again for the help. Hopefully one day i can get my hands on an iPhone4.

    Side note, What devices have the Gyroscope? I'm guessing just the iPhone4G?
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @CapnJ, the iPad 3G and the iPhone 4 have gyroscopes and the iPhone 3G, iPhone 4 and iPad 3G have a compass. Android plugins a bit tricky to make. Once the Android developer community reaches critical mass we plan to start offering some plugins for it.
     
  30. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    Hi CapnJ Prime31.... I have an iPad 64, no 3G, but it definitely has a compass and the plugins work perfectly !

    I had some problems in case of no GPS reception: in this case you have to reference magnetic north, otherwise it will fail (it needs GS fix to make compensation and find geographic north). Use magnetic north and it works perfectly even in you basement !
     
  31. CapnJ

    CapnJ

    Joined:
    Aug 6, 2009
    Posts:
    29
    @acme3D, OOO. So there is hope! I'll keep trying different configurations. Did the compass plugin work for you right out of the box?

    Thanks,
    CapnJ
     
  32. CapnJ

    CapnJ

    Joined:
    Aug 6, 2009
    Posts:
    29
    OK, so i must be losing my mind. Last night i published to iPad via and older version of Apple's SDK. Got no errors, but iPad would not run the installed application. To my surprise, i launched the app by accident today and everything works fine. I'm going to try to re-create the solution. Geese.
     
  33. acme3D

    acme3D

    Joined:
    Feb 4, 2009
    Posts:
    203
    Yes, it did work out of the box; the only "issue" was GPS-related, but if you use magnetic north you don't need to have a GPS fix, it just works.
     
  34. CapnJ

    CapnJ

    Joined:
    Aug 6, 2009
    Posts:
    29
    Got things working, i have to pub with xCode 2.3.2., i must have something goofed up in the latest xCode.

    Anyways, now that the test scene seems to be working great. What is the best way to access this great data from Javascript? Would it be a getComponent type of situation to make calls to the LocationManager GameObject? Sadly, this all may be from me not knowing too much about javascript talking to C#. Can anyone point me in a good direction or search term?

    Thanks again for the help, looking forward to using this plugin.
    Yar,
    CapnJ
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @CapnJ, just copy/paste the C# calls to the LocationManager into a JS file and it should work just fine.
     
  36. impla007

    impla007

    Joined:
    Jan 30, 2010
    Posts:
    57
    Hi There,

    I am having problems with the CoreLocation. Using the testScene and nothing else. Heading is working well but receiving coordinates is not working.
    When I press the button StartUpdatingLocation, it displays the coordinates once. After, it does not display any update of the coordinates when I move. I have instrumented the code and I have verify that the "locationServicesDidUpdate" is send only once at the beginning. I tried to change reduce the distance filter also and nothing happen either.

    I have verified that my gps is working correctly, with other apps that displays Lat/Lon correctly...

    Some help will be very welcome...

    It is on iPhone 3GS, OS4.1

    Thanks
     
  37. Prodev101

    Prodev101

    Joined:
    Aug 6, 2010
    Posts:
    49
    Just a quick note to say thanks Mike..

    Scalextric would not have been completed on time without your plugins.. Worth Twice the price without a doubt..


    ProDev101
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @impla007, I am not able to reproduce the problem on my end. I get updates as expected with nothing more than the sample scene. Try setting the setDistanceFilter to 1 and open the test scene before driving somewhere. Also be sure you allowed location services for the demo app.

    @ProDev101, glad we could make your life easier! That's what we are here for!
     
  39. impla007

    impla007

    Joined:
    Jan 30, 2010
    Posts:
    57
    @Prime, I just have the simple testscene, a fresh new project, a new bundle id etc I allowed the location services, set the distance filter to 1 meter and Lat/Lon are still frozen ?
    No refresh.
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @impla007, I am having no luck reproducing your issue. Can you try using the standard Unity location calls and see if you get a result with that?

    For example:

    Code (csharp):
    1. iPhoneSettings.StartLocationServiceUpdates();
    wait 10 - 20 seconds then:

    Code (csharp):
    1. if( iPhoneSettings.locationServiceStatus == LocationServiceStatus.Failed )
    2. {
    3.     // Update GUI with failure message
    4. }
    5. else
    6. {            
    7.     // Update GUI with values
    8. }
     
  41. impla007

    impla007

    Joined:
    Jan 30, 2010
    Posts:
    57
    @Prime, it works using iPhoneSettings. I get no error message when starting the service and I can retrieve coordinates using iPhoneInput.lastLocation
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @impla007, I would suggets using the iPhoneSettings for your case. I can't reproduce what you are experiencing any any of my test devices and this is the first report of any such bug. The code behind getting GPS position is very simple and I am 100% certain it is all coded correctly.
     
  43. impla007

    impla007

    Joined:
    Jan 30, 2010
    Posts:
    57
    Thanks Prime, I use the iPhoneSettings for lat/Lon and the pluging for heading. It works.... Sometimes, software is strange ?
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @impla007, if I could even come up with any explanation as to how or why that would happen I would. If only I could hook your phone up to my laptop and drive around for a while...

    The lat/lon stuff was really not needed in the plugin seeing as how it is already in Unity. The only reason it was added was so that location updates would be triggered by an event instead of having to poll.
     
  45. corey.stpierre

    corey.stpierre

    Joined:
    Nov 18, 2008
    Posts:
    79
    Hi Prime31. I am almost at the point in my project where I want to take advantage of the plugins that you have made. I have some simple questions that hopefully you can answer before I buy.

    I am interested in 3 plugins: Mobclix, StoreKit, and the GameCenter.

    My questions are:

    1. From experience talking with other developers, are developers making more money using just iAd or does Mobclix bring in more money?

    2. In terms of screen space, do iAds and Mobclix ads take up the same amount of screen space?

    3. Since my project requires IAP, I want to be able to disable ads as one of my "products". The API of the ad plugins you have expose a way to disable ads. Is this the right approach to take once a user purchases the product? It seems like it would be that simple. The only other logic is at application startup (check to see if the user has the product purchased; if yes, disable ads, if no, enable ads). Am I missing anything else in this regard? This is assuming I know how to setup the products correctly and understand the itconnect side of things.

    I am also using Unity 1.7.

    Thanks a lot.
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @corey.stpierre, first off only Unity 1.7 Pro has plugin support. To address your questions:

    1. they both have advantages and disadvantages. iAds pay more but the fill rate is lower. iAd will be rolling out to a few more countries shortly which should help the fill rate. You can actually pipe iAds through Mobclix so going that route you can actually get the best of both worlds. The disadvantage with Mobclix is that you have to include their library with your game so it ads a bit of size to your final binary which may or may not be an issue for you.

    2. both take up the same amount of screen real estate.

    3. Sounds like your plan will work fine for IAP
     
  47. langju

    langju

    Joined:
    Jul 1, 2009
    Posts:
    207
    Hi prime31,

    i have a question about the sendtoall method in the gamecenter plugin.
    Does sendtoall broadcast to all devices included the one where the call is done ?

    For example, 2 devices (A B)

    I have in my hand device A.
    I put my finger on it to launch a projectile, if i use sendtoall to instantiate my projectile, will it be visible on both device A and B or only on device B ?
    What is the best practice for that ?
    Do i have to "double" the call ?
    Like Instantiate for all devices with sendtoall but instantiate locally for device A ?

    thanks
     
  48. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @langju, it sends to all devices that are not the sending device so the projectile will only be on device B. For something like your situation that requires syncing you could just call sendToAll then immediately after call the same method locally on device A.
     
  49. langju

    langju

    Joined:
    Jul 1, 2009
    Posts:
    207
    Thanks Prime31, so we cannot use the well known server/client architecture meaning all is managed from serve, we have to make attention on who is sending the command .

    Thanks again for your fabulous scriptS :)
     
  50. nggs

    nggs

    Joined:
    Oct 23, 2009
    Posts:
    90
    Prime31,

    I can't seem to get the events tied to a cancelled or Failed purchase to work. I'm checking for them in Update like so:
    Code (csharp):
    1. StoreKitManager.purchaseFailed += onPurchaseFailed;
    2. StoreKitManager.purchaseCancelled += onPurchaseCancelled;
    and then the function signatures are as so:

    Code (csharp):
    1.  
    2. public void onPurchaseFailed(string productIdentifier) {
    3. Debug.Log("NADA");
    4. }
    5. public void onPurchaseCancelled(string productIdentifier) {
    6. Debug.Log("NADA");
    7. }
    8.  
    These have different but equally bad responses. purchaseFailed does not fire the event at all. purchaseCancelled fires the event repeatedly locking the system up!

    I'm using purchaseSuccessful in the same place in the same way and it always fires off ok. Any thoughts as to what I may be doing wrong? (I guessed at the function signatures, so maybe thats the problem with purchaseFailed)
     
Thread Status:
Not open for further replies.