I am trying to make unity webgl game. I'm currently working with my own python django server. But there's few problems I am confronting right now.
First, when client completes the payment behavior, it repeatedly shows javascript error. Here's the error code:
Invoking error handler due to
Uncaught abort(219) at Error
at jsStackTrace (lottery.wasm.framework.unityweb:8:22313)
at stackTrace [Object.stackTrace] (lottery.wasm.framework.unityweb:8:22484)
at Object.onAbort (https:/lottery-server.ntucorp.com/static/game/Build/UnityLoader.js:4:11047)
at abort ('lottery.wasm.framework.unityweb:8:521824')
at wasm-function[62206]:0x1143303
at wasm-function[25973]:0x9c45e6
at wasm-function[61403]:0x111d42f
at wasm-function[27992]:0xa2a9df
at wasm-function[50781]:0xeabcd7
at wasm-function[35699]:0xba8a56
at wasm-function[35698]:0xba8997
at wasm-function[35744]:0xbaa780
at wasm-function[26171]:0x9c9232
at wasm-function[35758]:0xbab0e3
at wasm-function[26171]:0x9c9232
at wasm-function[35768]:0xbab37e
at wasm-function[23663]:0x9815d2
at wasm-function[61943]:0x11424be
at dynCall_iiiii [Object.dynCall_iiiii] (lottery.wasm.framework.unityweb:8:494571)
at invoke_iiiii (lottery.wasm.framework.unityweb:8:362010)
at wasm-function[59810]:0x10db82f
at wasm-function[59101]:0x10b9e40
at wasm-function[4047]:0x197f91
at wasm-function[4046]:0x197ebf
at wasm-function[7537]:0x2c346b
at wasm-function[7534]:0x2c283b
at wasm-function[11356]:0x483dc2
at wasm-function[9973]:0x3cab31
at blob:https:/lottery-server.ntucorp.com/d6308b13-98d3-4a85-abfd-0c7db365fcfd:8:438788
at ccall [Object.ccall] (lottery.wasm.framework.unityweb:8:16382)
at SendMessage (lottery.wasm.framework.unityweb:8:9099)
at sendMessage [Object.sendMessage] (lottery.wasm.framework.unityweb:8:48724)
at uiCallback (lottery.wasm.framework.unityweb:8:50342)
at a.__wrapper.a.__wrapper (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:93:765)
at Object.cb (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:145:4420)
at c (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:145:10332)
at a.c.read (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:125:737)
at a._processor (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:127:283)
at a.b.enqueue (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:126:711)
at Object.u [as onMessage] (https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:143:2477)
at https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:136:2925
at https:/connect.facebook.net/en_US/sdk.js?hash=11641b2e4a5fab828e74fff5f206cf37&ua=modern_es6:50:208'''
I'm using Unity Facebook SDK, so in unity c# script I call this function.
FB.Canvas.Pay(
product_url,
quantity:1,
callback:ProductCallback
);
And, anyway it gives callback function back, and the response of this callback is this.
PayResponse:{"callback_id":"4","response":{"payment_id":1794879660642720,"amount":"2.99","currency":"USD","quantity":"1","request_id":"","status":"initiated","signed_request":"r4_00GLFbodYSMVeVGfFcfuzIr1HQKd9EYiO_OM0eXM.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImFtb3VudCI6IjIuOTkiLCJjdXJyZW5jeSI6IlVTRCIsImlzc3VlZF9hdCI6MTU3ODA0MzI2OCwicGF5bWVudF9pZCI6MTc5NDg3OTY2MDY0MjcyMCwicXVhbnRpdHkiOiIxIiwicmVxdWVzdF9pZCI6IiIsInN0YXR1cyI6ImluaXRpYXRlZCJ9"}}
And secondly I cannot make Facebook Unity SDK workable, which is FB.Canvas.PayWithProductID. It just don't work, It just omits javascript error (UnityLoader.js error which is similar to one which I already mentioned), and also it do not give callback.
Also In document, https://developers.facebook.com/docs/games_payments/payments_lite?locale=ko_KR In here it says proper code would be FB.PayWithProductID, but Facebook SDK does not have any FB.PayWithProductID. All it have is FB**.Canvas.**PayWithProductID.
How can I get proper callback from facebook? I cannot get any kind of callback parameters. All I recieve is that the fact facebook called my callback url, not containing any GET parameters. I just return request.GET.get('hub.challenge'), but anyway it is still None.
Why does it happen? please help.
This is a very broad question as it includes so much into this. I would recommend connecting your project to API and then call Facebooks API to take payments. Here is the documentation: https://developers.facebook.com/docs/graph-api/reference/v5.0/payment
I am only saying this because there is not a lot of context here as to how and where you're calling the payment method from. Are you already doing this from an API? or are you trying achieve this from the engine itself?
Here is an extremely useful guide on how you can call an API from unity:
https://www.red-gate.com/simple-talk/dotnet/c-programming/calling-restful-apis-unity3d/
I would highly recommend you do this API side as it safer than doing it through the engine, if that's what you are doing.
Related
Hopefully someone can point me in the right direction here, I'm attempting to log into Playfab using a google auth code retrieved from an async call in Unity, the flow is as follows:
Click my login to google button in Unity.
Unity begins to listen for the response and opens a google login browser session.
User clicks email/signs into email they want.
This response is returned to Unity with an auth code.
I have then attempted to use the returned google auth code with playfabs LoginWithGoogleAccount method":
PlayFabClientAPI.LoginWithGoogleAccount(new LoginWithGoogleAccountRequest()
{
TitleId = PlayFabSettings.TitleId,
ServerAuthCode = returnedWindowsGoogleAuthCode,
CreateAccount = true,
}, OnPlayfabGooglePlayAuthComplete, OnPlayfabGooglePlayAuthFailed);
This then fails with a returned response from playfab with "invalidGoogleToken".
From what I've read from what I've come across on google is that this token is possibly in a "used" state by the time I am calling LoginWithGoogleAccount and I possibly need a refreshed token? but I am not too familiar with the Google API so I could be completely off the mark there? But if this is the case what should I do here? How do I re-request a valid token without going back to the browser to do the same thing again?
To give you an idea of pretty much the exact code I'm looking at but I've altered slightly to get it to work in Unity I am following the Google Sample OAuthDesktopApp code:
OAuthDesktopApp Sample Code
I am calling the method "button_Click", this runs and makes the request, Unity then begins listening for the google response at line 72 and the auth code is then output to logs at line 129.
This auth code output at line 129 is what I have then been passing back in to LoginWithGoogleAccount which then results in the failed "invalidGoogleToken", this does also then run a request for user information which does correctly return the name/email of the user you signed in with etc.
Just to add to my previous comments, if I remove the call to performCodeExchange line 132 (I read somewhere that at that point I am swapping the auth code for a token and thus the auth code will no longer work? I'm guessing here) and then if I call PlayFabClientAPI.LoginWithGoogleAccount with the auth code I am presented with:
PlayFabError error:
error.GetHashCode(): 2051826304
error.Error: InvalidGoogleToken
error.ErrorMessage: invalid_grant details: Missing code verifier.
error.ErrorDetails: null
Hopefully this may help someone guide me.
First thanks to those that replied to this, So I've managed to solve this after a comment from a Playfab mod, There appears to be no official way from Google to login using a standlone Unity build nor an official way to then login to Playfab using the same build method.
The solution I've used uses a modified Unity version of one of the Google samples from OAuth 2.0 for Mobile & Desktop Apps .
This will allow you to get the oauth code within Unity then you can pass this oauth code to Playfab for login, BUT Playfab has since deprecated the way to do this (which is silly if its the only solution) so you need to modifiy Playfabs SDK to include the accesstoken then you can use this to finally login.
I am trying to test Facebook Canvas Payments within my Unity game, more specifically, asynchronous payment methods, however there seems to be a problem. Whenever I get to the Asynchronous Payment debug screen where you can select what sort of resolution to receive (This thing) the browser is giving me an error "TypeError: window.parent.require(...) is undefined" in Firefox and "Unable to get property 'processIFrame' of undefined or null reference" in IE.
Anybody got any ideas/ways to fix this?
This is a known bug, that is currently being tracked here: https://developers.facebook.com/bugs/1457965634504096/
I'm developing Facebook payment interface for my game. I did everything as described in documentation. And I came to the strange situation where "Asynchronous Payment Method" works just fine (I see callback calls to my server) but immediate "Test Payment Method" doesn't work (I do not see callback call to my server). Instead FB.ui call returns this error:
{
error_code: 1383066,
error_message: "Something went wrong while processing your payment…harged for this transaction, so please try again."
}
Here is a screenshot with error: http://monosnap.com/image/DetZ1VqEy1d7yuiVXdJLUZdL1Ukl45
Can anyone help?
p.s. I searched in Internet ant there is no information about FB API Error 1383066
Problem just gone by itself. I think that it was an issue on FB side and they just fixed it.
I've create an facebook app and it run smoothly at
https://apps.facebook.com/icoloringstar/
But the problem is: when I search my app name "icoloring star" in facebook, it link to the app at url:
https://apps.facebook.com/icoloringstar/?fb_source=search&ref=ts
Then facebook said that:
App "iColoring Star" is unavailable
The app "iColoring Star" is temporarily unavailable due to an issue with its third-party developer. We are investigating the situation and apologize for any inconvenience.
We found that url part "ref=ts" cause above problem, but really do not know why?
Could you explain me why and how to resolve this problem?
Thank you very much.
It sounds like your code is failing when the ref parameter is supplied in the request path.
I was able to repro this with any arbitrary value in the ref parameter when accessing your app
Check your server logs and and see if you're returning a 500 error to facebook when the request comes in
See if you have any code that parses a ref parameter and check it's not throwing exceptions
Make sure your callback URL in the app settings doesn't also specify a ref parameter or your app may receive two values and/or fail entirely
It means 'Top Search'. User enter a query into the top of search.
There are some ref parameters.. ref=bookmarks for example. I dont know the full list.
Did you put your app on Facebook App Center?
Well i started of by following all the instructions here:
http://code.google.com/p/xmppframework/wiki/FacebookChatHowTo
I used the recommended fork of the facebook api and tried the latest from:
https://github.com/facebook/facebook-ios-sdk/
My problem starts with the following error:
< failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">< not-authorized/></failure>
The error is a reply from facebook to xmppframework s response to a authentication challenge. The response that is made by the iphone is base64 encoded msg when i decode it i find 2 of the values are null:
api_key=(null)
and the
session_key=(null)
This is obviously the reason facebook is returning that error. But the problem i have is i cant seem to find any where to set these values in the framework. Besides i think the session_key should be pulled in from facebook anyway.
I guess what i want to know is a couple of things.
Has any one got the xmppframework working with facebook on a iDevice?
If you have got it working did you have to stray from the path of the instructions on http://code.google.com/p/xmppframework/wiki/FacebookChatHowTo ?
do you know of any other method to get facebook chat working on the iphone?
Any suggestions or help for my current dilemma would be appreciated. Happy to share my code if you want.
cheers
I wrote the Facebook integration for XMPPFramework. The api_key and session_key, come from a call to auth.PromoteSession. Facebook is trying to deprecate that call, so to enable it, you must follow step 7, in the HowTo:
Under Migrations, change Disable Deprecated Auth Methods from Enabled to Disabled and Save Changes.