Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missing dll and issues with WebGL #160

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions Facebook.Unity.Canvas/CanvasJSWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public void Init(string connectFacebookUrl, string locale, int debug, string ini

public void Login(IEnumerable<string> scope, string callback_id)
{
login(scope, callback_id);
var scopeList = new List<string>(scope);
var scopeListJson = MiniJSON.Json.Serialize(scope);

login(scopeListJson, callback_id);
}

public void Logout() {
Expand All @@ -58,7 +61,10 @@ public void Login(IEnumerable<string> scope, string callback_id)
}

public void LogAppEvent(string eventName, float? valueToSum, string parameters) {
logAppEvent(eventName, valueToSum, parameters);
if (valueToSum.HasValue)
logAppEvent(eventName, valueToSum.Value, parameters);
else
logAppEventWithoutValue(eventName, parameters);
}

public void LogPurchase(float purchaseAmount, string currency, string parameters) {
Expand All @@ -77,7 +83,7 @@ public void Login(IEnumerable<string> scope, string callback_id)
private static extern void init(string connectFacebookUrl, string locale, int debug, string initParams, int status);

[DllImport("__Internal")]
private static extern void login(IEnumerable<string> scope, string callback_id);
private static extern void login(string scope, string callback_id);

[DllImport("__Internal")]
private static extern void logout();
Expand All @@ -86,7 +92,10 @@ public void Login(IEnumerable<string> scope, string callback_id)
private static extern void activateApp();

[DllImport("__Internal")]
private static extern void logAppEvent(string eventName, float? valueToSum, string parameters);
private static extern void logAppEvent(string eventName, float valueToSum, string parameters);

[DllImport("__Internal")]
private static extern void logAppEventWithoutValue(string eventName, string parameters);

[DllImport("__Internal")]
private static extern void logPurchase(float purchaseAmount, string currency, string parameters);
Expand Down