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

    wilfred

    Joined:
    Nov 14, 2011
    Posts:
    17
    Hi Prime,

    I know twitter have Rate Limited to post image. What will plugin fire loginFailedEvent if I reach the Rate Limited and cannot post image? Thanks.
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wilfred, I am not sure what you are referring to. Please send a link to the Facebook documentation that references what you are referring to. Our events almost always match Facebooks names if that helps.
     
  3. wilfred

    wilfred

    Joined:
    Nov 14, 2011
    Posts:
    17
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wilfred, I have never been rate limited before but assuming the response is just a standard failure the twitterPostFailed should fire.
     
  5. Alessaint

    Alessaint

    Joined:
    Mar 21, 2011
    Posts:
    43
    Hi Prime31,

    I have some problems with MoPub plugin on Ipad3.

    Creating the add at this x position

    (Screen.width - 320) /2

    centers the MoPubBannerType.Size320x50 correctly on lower resolutions but on the new iPad (possibly due to some upscaling-issues) the ad is far off to the right.

    Is this a bug or am I missing something obvious?

    Thanks

    Ales
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @alessiant, the iPad 3 is a retina screened device so you cannot use Unitys Screen.width directly. Unity operates in pixels while iOS operates in points. An iPad 1, 2 and 3 are all 1024x768 points in the iOS world so you need to divide your calculation by 2.
     
  7. FmRyu

    FmRyu

    Joined:
    Apr 18, 2012
    Posts:
    6
    Hi,

    i want to get a callback after the any offer is to reward players. For example, when using the banner on the android.
     
  8. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    Hi Prime! I'm trying to use the social networking plugin to display a twitter feed, like so:

    Code (csharp):
    1.     public TextMesh inputText, feedText;
    2.     public void UpdateFeed()
    3.     {
    4.         var dict = new Dictionary<string,string>();
    5.         string screenName=TwitterBinding.loggedInUsername();
    6.         TwitterBinding.performRequest( "GET", "/statuses/user_timeline.json?include_entities=true&include_rts=true&trim_user=true&screen_name="+screenName+"&count=20", dict );
    7.         feedText.text="";
    8.         foreach(KeyValuePair <string,string>  pair in dict)
    9.             feedText.text+=pair.Key+" : "+pair.Value+System.Environment.NewLine;
    10.        
    11.     }
    12.    
    however I always get this debug message

    Code (csharp):
    1. Successfully logged in to Twitter
    2.  
    3. twitterRequestDidFinishEvent with no data
    (at first I've tried it without all of those parameters but the result was the same)
     
  9. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @yuri, what does your event handler look like? Are you using the ReauktLogger class to dump the data to debug?
     
  10. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    okay maybe I'm really dumb- currently apart from the above I have the TwitterEventListener/ TwitterManager dragged into the scene- I assumed that was enough, as for logging I just got that in Xcode didn't really do anything

    EDIT: ahah!

    TwitterBinding.getHomeTimeline();

    void twitterHomeTimelineReceived( ArrayList result )
    {
    Debug.Log( "received home timeline with tweet count: " + result.Count );
    }


    seems everything was already done for me and I was just doing something overly complicated
     
    Last edited: Apr 30, 2012
  11. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    okay I think I'm still doing something wrong: I'm getting this error in Xcode:

    Code (csharp):
    1. NullReferenceException: A null value was found where an object instance was required.
    2.   at InventoryTouchTwitter.twitterHomeTimelineReceived (System.Collections.ArrayList result) [0x00010] in [B]//<redacted>[/B]
    3.   at (wrapper delegate-invoke) System.Action`1<System.Collections.ArrayList>:invoke_void__this___ArrayList (System.Collections.ArrayList)
    4.   at TwitterManager.twitterHomeTimelineDidFinish (System.String results) [0x00016] in /Users//[B]<redacted>[/B]OS/TwitterManager.cs:82
    my code is now
    Code (csharp):
    1.  
    2.     void OnEnable()
    3.     {
    4.         EtceteraManager.singleFieldPromptTextEntered += singleFieldPromptTextEntered;
    5.         TwitterManager.twitterHomeTimelineReceived += twitterHomeTimelineReceived;
    6.  
    7.     }
    8.     void OnDisable()
    9.     {
    10.         EtceteraManager.singleFieldPromptTextEntered -= singleFieldPromptTextEntered;
    11.         TwitterManager.twitterHomeTimelineReceived -= twitterHomeTimelineReceived;
    12.     }
    13.    
    14.    
    15.     public void OnPostToTwitter()
    16.     {
    17.             TwitterBinding.postStatusUpdate(twitterMessage);   
    18.             UpdateFeed();
    19.     }
    20.  
    21.     void twitterHomeTimelineReceived( ArrayList result )
    22.     {
    23.         feedText.text="";
    24.         Debug.Log ("result count:"+result.Count);
    25.         //for(int i=0;i<result.Count;i++)
    26.         //{
    27.         //  Debug.Log (result);
    28.         //}
    29.     }
    30.  
    31.         public void UpdateFeed()
    32.     {
    33.         var dict = new Dictionary<string,string>();
    34.         string screenName=TwitterBinding.loggedInUsername();
    35.         //TwitterBinding.performRequest( "GET", "/statuses/user_timeline.json?screen_name="+screenName+"&count=6", dict ); 
    36.         TwitterBinding.getHomeTimeline();
    37.         feedText.text="";
    38.     //  foreach(KeyValuePair <string,string>  pair in dict)
    39.         //  feedText.text+=pair.Key+" : "+pair.Value+System.Environment.NewLine;
    40.        
    41.     }
    42.  
    43.  
     
    Last edited: Apr 30, 2012
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @yuri, for debugging stick a call to the ResultLogger in there. It can dump to the console Arraylists, Hashtables and any combination of the two.
     
  13. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    Hello, Prime31. I'm working on implementing StoreKit plugin into our project. I apologize if this question has been asked too many times, but I'm trying to figure out which products a user bought (preferably offline). I'm using C# for scripting, by the way.

    In particular, I was wondering which transactions from "StoreKitBinding.getAllSavedTransactionsFromDefaults()" were stored in the device. Do these transactions include canceled or failed purchases? Or only transactions that succeeded?

    Furthermore, are the stored transactions guaranteed to have a valid receipt, or do I have to verify every one of them?

    Does the receipt verification require an online connection? What happens if I try to verify a receipt, and it fails? Is the transaction associated with that receipt retained, or deleted from the directory?

    As mentioned earlier, I'm trying to make the purchased products available even when the user is offline. If it's entirely possible that the stored transactions contain unverified receipts, and we cannot verify this without an internet connection, it'd mean we'd require the user to be connected to the internet to use the purchased assets. Which would kind of suck...
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @japtar, only successful transactions are stored. There is no guarantee at all with regard to them. They are merely stored as a convenience. Proper receipt verification absolutely requires an external server. What most folks who actually do receipt verification do is make the purchased products available of there is no Internet connection available and only do validation when it is.
     
  15. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    Thanks for the thorough answer. The fact that a connection is required to verify if a transaction is valid is a bit annoying. I guess I can store any transactions that I've verified last session, and re-attempt to verify them whenever I have a chance.

    Another question. What does the documentation mean when it says that event "receiptValidationSuccessful" doesn't automatically mean success? Does that mean that I need to use "receiptValidationRawResponseReceived" to figure out if the receipt was valid or not?
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @japtar, if you intend to do proper receipt validation you absolutely should do it on an external server. It is not recommended to use the validation methods that occur on the device. They are left in the plugin only for legacy reasons.
     
  17. XxPleYxX

    XxPleYxX

    Joined:
    Jul 26, 2011
    Posts:
    41
    Yes i´m checking the isPlayable attribute and i´m playing the test scene and the same, isnt DRM song and the log shows the following:


    (Filename: /Applications/buildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

    file was exported. going to load and play it now: /var/mobile/Applications/284DEF85-BF43-491D-B70B-4C7D6DA2853F/Documents/someExportedSong.mp3

    (Filename: /Applications/buildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

    exportedFileFromLibraryEvent: /var/mobile/Applications/284DEF85-BF43-491D-B70B-4C7D6DA2853F/Documents/someExportedSong.mp3

    (Filename: /Applications/buildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

    loading audio file failed with error: The requested URL was not found on this server.

    (Filename: /Applications/buildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

    loaded audio file from disk

    (Filename: /Applications/buildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)




    PD: the latest version of the plugin does not show any path.
     
  18. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @xxpley, it looks like the error is in the URL being passed to Unitys WWW class to load the file. What is the URL that is being passed to the WWW classes constructor?
     
  19. devil1121

    devil1121

    Joined:
    May 10, 2011
    Posts:
    45
    @Prime31 I have been trying to run the ChartBoost test scene on my device but theses error messages appear. Do you have any idea why? Thanks

    Code (csharp):
    1. Undefined symbols for architecture armv7:
    2.   "_CGContextTranslateCTM", referenced from:
    3.       -[CBUnderfinedProgressBar drawRect:] in libChartBoost.a(CBUnderfinedProgressBar.o)
    4.   "_CGContextClip", referenced from:
    5.       -[CBUnderfinedProgressBar drawRect:] in libChartBoost.a(CBUnderfinedProgressBar.o)
    6.   "_CGGradientCreateWithColors", referenced from:
    7.       -[CBDefaultBackgroundView drawRect:] in libChartBoost.a(CBDefaultBackgroundView.o)
    8.   "_CGAffineTransformMakeRotation", referenced from:
    9.       -[CBDefaultViewController orientView:] in libChartBoost.a(CBDefaultViewController.o)
    10.   "_CGContextAddPath", referenced from:
    11.       -[CBUnderfinedProgressBar drawRect:] in libChartBoost.a(CBUnderfinedProgressBar.o)
    12.   "_CGContextDrawRadialGradient", referenced from:
    13.       -[CBDefaultBackgroundView drawRect:] in libChartBoost.a(CBDefaultBackgroundView.o)
    14.   "_CGAffineTransformIdentity", referenced from:
    15.       -[CBDefaultViewController orientView:] in libChartBoost.a(CBDefaultViewController.o)
    16.   "_CGGradientRelease", referenced from:
    17.       -[CBDefaultBackgroundView drawRect:] in libChartBoost.a(CBDefaultBackgroundView.o)
    18. ld: symbol(s) not found for architecture armv7
    19.  
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @devil, looks like a missing reference to CoreGraphics.framework in your Unity project.
     
  21. devil1121

    devil1121

    Joined:
    May 10, 2011
    Posts:
    45
    @Prime31 Do you know why is that? Is it because i have Unity 3.3?
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @devil, wow. Time to update! I don't even remember how long it's been since Unity included it by default.
     
  23. devil1121

    devil1121

    Joined:
    May 10, 2011
    Posts:
    45
    @Prime31 Ok :p i knew it would happen someday but you know why change something that works well. Thank You for the heads-up.
     
  24. ridil

    ridil

    Joined:
    Apr 24, 2012
    Posts:
    31
    Hello,

    I'm working on integrating your SocialNetworking plugin. I need to create a "Like" button in game which will like our app on facebook with the users logged in account and then return a callback to the game once this occurs (since we will be giving them a reward in-game for doing so). I haven't been able to find any examples of ways to do this. I'm assuming I use the graph api for this but I'm not sure how. For reference, I have completed registering the app on facebook and am able to login/connect fine I just don't know how to do a "like" button function which returns a call to the app on success. Any help would be greatly appreciated.

    Also, I was able to get the iCloud stuff working successfully! Thank you for all your help on that, it was quite a rough ride.

    - Ridil
     
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Ridil, you will want to consult Facebooks Graph API documentation for the details of what is available. There are hundreds of paths exposed in there. Glad to hear iCloud is up and running!
     
  26. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    I don't quite understand. If I don't have access to the external server, what should I do? Lock off all the products? Treat all the transactions as valid, and unlock the respective products? Or am I missing a function I'm unaware of?
     
  27. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @japtar, if there is no Internet connection there is no way to validate a purchase. You should assume it to be valid in that case unless you want some angry customers.
     
  28. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    Er...then I'm not sure how the method I considered -- storing the state whether a transaction was valid last time we were able to verify to the external server -- is particularly bad. I mean, I plan on checking the receipt on app boot-up all the time. If receipt verification succeeded, great! I'll mark the transaction as valid. If it failed due to inability to connect to the external server, I'd resort to the last state held. And of course, if the verification failed for any other reason, I'd mark the transaction as invalid.

    Edit: oh yeah, and if there is no transaction associated with a product, I don't store it. If a hacker managed to change the stored settings, they'd still have to have the transaction available first, and verified by the external server.

    Is there a flaw in this process that I'm not seeing here?
     
    Last edited: May 2, 2012
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @japtar, that is about the best you can do when dealing with no internet connection to validate.
     
  30. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    hi! another question regarding the social networking plugin- currently I try to log in like so:

    Code (csharp):
    1.     public void OnPostFacebook()
    2.     {
    3.         Debug.Log("Facebook logged in = "+FacebookBinding.isSessionValid());
    4.         if(!FacebookBinding.isSessionValid())
    5.         {
    6.             FacebookBinding.loginWithRequestedPermissions(new string[] {"publish_stream"});
    7.             return;    
    8.         }
    9.     ///some other stuff
    but what seems to occur is, I get taken to the Facebook login screen, I click "allow all" and nothing happens- I have to manually switch back to my app from the Facebook "how apps work" screen- next I get a screen about learning how apps works with Ok being the only option
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @yuri, please see our docs (http://prime31.com/unity/docs) and Facebooks paying special attention to URL scheme setup (required for Facebook to open your app) and setting the proper bundle ID for your app in Facebooks web portal.
     
  32. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I notice EtceteraBinding.m has uniqueDeviceIdentifier and apparently Apple is rejecting apps that use UDID. What does it use it for and can I edit that out? On a tight deadline and want to be 110% my app doesn't get rejected.
     
    Last edited: May 2, 2012
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @jtown, you can of course edit it out if you want to. It uses the devices mac address to generate a unique identifier.
     
  34. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Just want to make sure it won't break anything else.
     
  35. ridil

    ridil

    Joined:
    Apr 24, 2012
    Posts:
    31
    Hello,

    Today I started gettign the following exception from the P31Cloudfile class when calling the WriteAllBytes function:

    IOException: Invalid handle to path "/private/var/mobile/Library/Mobile Documents/myApp/9ufvh02q4h.txt"

    System.IO.FileStream.WriteInternal (System.Byte[] src, Int32 offset, Int32 count)
    System.IO.FileStream.Write (System.Byte[] array, Int32 offset, Int32 count)
    System.IO.File.WriteAllBytes (System.String path, System.Byte[] bytes)
    P31CloudFile+LocalFileManager.writeAllBytes (System.String file, System.Byte[] bytes)
    P31CloudFile+CloudFileManager.writeAllBytes (System.String file, System.Byte[] bytes)
    P31CloudFile.writeAllBytes (System.String file, System.Byte[] bytes)

    It's causing the cloud file to write out properly but the local file doesn't write out and throws an IOException.

    Any idea what's causing this or how to fix it?

    - Ridil
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Ridil, that exception is getting thrown from internal classes. I do not know what on iOS could cause the IO framework to not be able to get a proper file handle.
     
  37. golden_gate

    golden_gate

    Joined:
    Jul 22, 2009
    Posts:
    81
    @prime31

    Do you think the updated movie texture plug in is going to be released this week. Looking to purchase the version with the new update...
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @golden, it will probably go out with full support for multiple video textures and beta support for audio playback this week.
     
  39. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    Hi! question regarding chartboost- sometimes when you click an ad, and it takes you to a web page, when you return to the app the app "starts over" (like you've exited and entered it, starts from the splash screen) - what could cause this?
     
    Last edited: May 3, 2012
  40. FmRyu

    FmRyu

    Joined:
    Apr 18, 2012
    Posts:
    6
    Hi,

    I can't award player by the conditions of offers (flarry In app circle), I understand you right?

    Thanks,

    Dmitry
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @yuri, that will happen of iOS needs to recover memory and kills your app to get it.


    @fmryu, I'm not sure I understand your question. Can you be more specific?
     
  42. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    Hey, Prime31. Still working on the Storekit stuff. Just wondering, when I receive a receipt success or failed event, how do I know which receipt was verified? Do I use receiptValidationRawResponseReceived? What is contained in the string argument for receiptValidationRawResponseReceived?
     
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @japtar, receiptValidationRawResponseReceived returns the actual status code from Apple. You should only validate one receipt at a time so that you know which you are getting a return from. Technically, if you want to do validation properly it should be done on an external server. We only left the old validate methods in there for legacy support and it isn't recommended to use them. Proper and secure validation can only be done off the device.
     
  44. FmRyu

    FmRyu

    Joined:
    Apr 18, 2012
    Posts:
    6
    Of course) I want to integrate into my application In App Circle plug-in, and I want to reward a successful agreement with the offers, for example, after viewing the ads, I want to give the player 5 carrots or something like that. To do this I need to get any callback, but as far as I could see the plugin does not take such events...

    Thanks.
     
  45. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @fmryu, you can setup a callback URL with Flirry and they will long your server whenever a user does something that can be rewarded.
     
  46. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    748
    What would cause a Facebook.instance.postImage to successfully post on my wall but when I use another phone which is currently logged into someone else's facebook account via the facebook app and safari the post photo still posts on my wall?

    Code (csharp):
    1.  
    2. FacebookBinding.init("268760236552745");
    3.        
    4.         Facebook.instance.accessToken = FacebookBinding.getAccessToken();
    5.    
    6.         if (!FacebookBinding.isSessionValid())
    7.         {
    8.  
    9.             FacebookBinding.loginWithRequestedPermissions( new string [] {"publish_stream", "photo_upload"} );
    10.             // A successful login will call another function to postImage
    11.  
    12.         }
    13.         else
    14.         {
    15.        
    16.             Facebook.instance.postImage(bytes,GameVars.StoreLink, FacebookHandler );
    17.  
    18.    
    19.         }
     
  47. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @trooper, you will need to open a bug report with Facebook to get any info pertaining to what happens on their servers. We have no way of knowing what happens once the data leaves the device.
     
  48. bigcheese_

    bigcheese_

    Joined:
    Sep 6, 2011
    Posts:
    31
    Hello,

    I have 2 question about the etcetera plugin for both android and iOS.

    1- Is there a way to get an image from the galary without having to resize it ?! or is there a way to preserve the resolution of the image received?!

    2- When I prompt to take a photo on the android, everything works fine except the plugin doesn't seem to be returning the photo as a texture, I tried the supplied Android demo, after I take a photo and proceed the texture doesn't get applied on the plane.

    P.S I sent this as an Email, since I didn't know about this forum before, sorry for double posting.
     
  49. nshack31

    nshack31

    Joined:
    Nov 4, 2011
    Posts:
    96
    im using the following to create an admob banner for ios..


    AdMobBinding.createBanner( AdMobBannerType.SmartBannerPortrait, 0, 1 );

    but it is placed at the top of the device rather than the bottom, seems to work fine on android. any ideas? thanks
     
  50. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @big, I already answered your email.


    @nshack, iOS works a bit different. You can put a smart banner at any y-location you want so in your example you are putting it 1 pixel from the top of the screen.
     
Thread Status:
Not open for further replies.