Skip to content

Commit

Permalink
update support auth types
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhichao Link committed Feb 3, 2023
1 parent f4f7020 commit 7b01642
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Assets/ParticleNetwork/Scripts/Demo/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async void Login()
{
// Show login with particle auth, support apple and google.
var nativeResultData = await ParticleAuthService.Instance.Login(LoginType.PHONE, "",
SupportAuthType.APPLE | SupportAuthType.GOOGLE);
SupportAuthType.APPLE | SupportAuthType.GOOGLE | SupportAuthType.EMAIL);
// Get result
Debug.Log(nativeResultData.data);
if (nativeResultData.isSuccess)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public enum SupportAuthType
TWITCH = 1 << 6, // 64
MICROSOFT = 1 << 7, // 128
LINKEDIN = 1 << 8, // 256
ALL = (1 << 9) - 1, // 511
PHONE = 1 << 9, // 512
EMAIL = 1 << 10, // 1024
ALL = (1 << 11) - 1, // 2048 - 1
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

using System;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Network.Particle.Scripts.Core.UnityEditorTestMode;
Expand Down
4 changes: 4 additions & 0 deletions Assets/ParticleNetwork/Scripts/Utils/ParticleTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public static List<String> GetSupportAuthTypeValues(SupportAuthType supportAuthT

foreach (SupportAuthType item in Enum.GetValues(typeof(SupportAuthType)))
{
if (item == SupportAuthType.ALL)
{
continue;
}
if ((item & supportAuthTypes) != 0)
{
if (!authTypeList.Contains(item.ToString()))
Expand Down

0 comments on commit 7b01642

Please sign in to comment.