Login & Logout
Learn how to login to snapchat and logout

Login Status

Check if user is already logged into Snapchat service. This returns true if user is already logged in and you don't need to login again.
1
using VoxelBusters.SnapchatKit;
2
3
public void IsLoggedIn()
4
{
5
bool isLoggedIn = SnapchatKitManager.IsLoggedIn();
6
string message = isLoggedIn ? "User logged in!" : "User not logged in yet!";
7
Debug.Log(message);
8
}
Copied!

Login

This opens Snapchat app and asks user to allow access. Capture the login status in the callback.
1
using VoxelBusters.SnapchatKit;
2
3
public void Login()
4
{
5
SnapchatKitManager.Login(OnLoginComplete);
6
}
7
8
private void OnLoginComplete(bool success, string error)
9
{
10
string message = success ? "Successfully Logged In" : "Failed Logged In : " + error;
11
Debug.Log(message);
12
}
Copied!

Logout

This logouts from the snapchat service. Post this operation until you login, you can share any content.
1
using VoxelBusters.SnapchatKit;
2
3
public void Logout()
4
{
5
SnapchatKitManager.Logout(OnLogoutComplete);
6
}
7
8
private void OnLogoutComplete(bool success, string error)
9
{
10
string message = success ? "Successfully Logged Out" : "Failed Logged Out : " + error;
11
Log(message);
12
}
Copied!
Last modified 2yr ago
Copy link