Skip to content

Commit dfeadca

Browse files
authored
Merge pull request #30 from ethereum-boilerplate/bugs/ios-xcode-websocket-issue
Bugs/ios xcode websocket issue
2 parents 5a63610 + cc61bfa commit dfeadca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2437
-2486
lines changed

Assembly-CSharp-Editor.csproj

Lines changed: 210 additions & 204 deletions
Large diffs are not rendered by default.

Assembly-CSharp.Player.csproj

Lines changed: 186 additions & 192 deletions
Large diffs are not rendered by default.

Assembly-CSharp.csproj

Lines changed: 197 additions & 203 deletions
Large diffs are not rendered by default.

Assets/MoralisWeb3ApiSdk/Example/DemoScene.unity

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47696,11 +47696,11 @@ PrefabInstance:
4769647696
objectReference: {fileID: 71058177}
4769747697
- target: {fileID: 6266890725912523073, guid: 116667ed98661304da1568439e2a3426, type: 3}
4769847698
propertyPath: Web3RpcNodeUrl
47699-
value: SPEEDY NODE
47699+
value: RPC NODE URL
4770047700
objectReference: {fileID: 0}
4770147701
- target: {fileID: 6266890725912523073, guid: 116667ed98661304da1568439e2a3426, type: 3}
4770247702
propertyPath: MoralisServerURI
47703-
value: SERVER URL
47703+
value: SERVER URI
4770447704
objectReference: {fileID: 0}
4770547705
- target: {fileID: 6266890725912523073, guid: 116667ed98661304da1568439e2a3426, type: 3}
4770647706
propertyPath: MoralisApplicationId

Assets/MoralisWeb3ApiSdk/Example/Scripts/AwardableController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async void Awake()
6464
{
6565

6666
}
67-
67+
6868
// Update is called once per frame
6969
async void Update()
7070
{

Assets/MoralisWeb3ApiSdk/Example/Scripts/MainMenuScript.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public class MainMenuScript : MonoBehaviour
6666

6767
Image menuBackground;
6868

69+
void OnApplicationQuit()
70+
{
71+
walletConnect.CLearSession();
72+
}
6973
async void Start()
7074
{
7175
menuBackground = (Image)gameObject.GetComponent(typeof(Image));
@@ -192,8 +196,27 @@ public async void WalletConnectHandler(WCSessionData data)
192196
}
193197

194198
HideWalletSelection();
199+
200+
SaveScore(10.0f);
195201
}
196202

203+
public class MyScores : MoralisObject
204+
{
205+
public string Name;
206+
public float Seconds;
207+
}
208+
209+
async void SaveScore(float time)
210+
{
211+
var user = await MoralisInterface.GetUserAsync();
212+
var addr = user.authData["moralisEth"]["id"].ToString();
213+
//var ens = MoralisInterface.GetClient().Web3Api.Resolve.ResolveAddress(addr);
214+
var score = MoralisInterface.GetClient().Create<MyScores>();
215+
score.Name = "Bob"; // !string.IsNullOrEmpty(ens.Name) ? ens.Name : addr;
216+
score.Seconds = time;
217+
await score.SaveAsync();
218+
Debug.Log("SavedScore");
219+
}
197220
/// <summary>
198221
/// Closeout connections and quit the application.
199222
/// </summary>

Assets/MoralisWeb3ApiSdk/Moralis/ISubscriptionQuery.cs.bak.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

Assets/MoralisWeb3ApiSdk/Moralis/MobileLogin.cs.bak.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

Assets/MoralisWeb3ApiSdk/Moralis/Moralis.Network/Client/WebSocket.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if UNITY_WEBGL
2+
using System;
23
using System.Collections.Generic;
34
using AOT;
45
using System.Runtime.InteropServices;
@@ -169,3 +170,4 @@ public void DelegateOnCloseEvent (int closeCode) {
169170

170171
}
171172
}
173+
#endif

Assets/MoralisWeb3ApiSdk/Moralis/Moralis.Network/Client/WebSocketFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if UNITY_WEBGL
2+
using System;
23
using System.Collections.Generic;
34
using System.IO;
45
using System.Net.WebSockets;
@@ -143,3 +144,4 @@ public static WebSocket CreateInstance(string url)
143144
*/
144145
}
145146
}
147+
#endif

0 commit comments

Comments
 (0)