Is there Swift Web3Login API in Moralis?

Hi!
I am a Web3Newveloper!!

I am trying to login using metamask with multi chains.
But
I have issue…please help me…angel…

I’m now using ā€˜Glaip’ SDK.

I want to ā€œstay logged inā€ until I log out.
But if I use glaip, I have to log in every time I open the app.
Does Moralis have a Example metamask login project implemented with SiwftUI? (I wish it was the complete source code.).
And I don’t know how to implement the ability to keep logged in.

We don’t have a tutorial for swift from what I know.
Usually you have to save the session token somewhere on the local system in order to keep the user authenticated.

Thank you so much…
One last question plz help…

I use this code, and i want to save session in local or firebase database…
Is there any document recomment?..
Please help me… sorry… It`s to hard web3 develop…

this code doesn’t seem to be related to an authenticated user, it looks like it makes a request to an web3api function

saving a session token for an authenticated users is not related to web3

how do you login when you open the app? you only connect the wallet or you also sign a message?

My problem is that once I don’t know where the session is,
And even if find it, I don’t know where to store it or how to delete it.

How do I access the session?

This is login function and logout function

and this is Wallet Link Service


it doesn’t look like it is a session from that logout function, it looks like it only connects the wallet and disconnects it, I don’t think that you can keep the wallet connected when you close the application

1 Like

yes. so i want to save session, but i don`t know how to get session.
The scenario like this.

1)First, Login using metamask(I used glaip package, it only connects the wallet and disconnects)
2)Like firebase auth, i want to save session somewhere.

How to do that like 2??

What type of data do you want to save in this ā€œsessionā€ that you’re creating?

Like cryptokid said, your code seems to only connect the wallet e.g. you’re not using Auth API. So it’s really up to you how you want to do it.

Thanks to your reply.
I want to save session in native ios using swiftui
But it seems Moralis doesn`t support what i want…

So I think

  1. Firebase auth using wallet address(not email. only use walletaddress)
  2. and save session.

Is it possible??

This is exactly what Moralis’s Auth API (Web3 authentication) is for which can be used with Firebase Authentication. The user authenticates with their wallet and the user is saved in Firebase.

We don’t have a Swift tutorial but you can look at some of the tutorials here to get an idea and then integrate with Firebase using their SDK or any backend you want where the session will be saved.

Thank you so much.
But i`m a newbie… so after many many thinkings…
I have a solution

  1. Using Local DB
  2. Firestore connect with local DB

I think it is now a perfect solution…
But if you think some problems will occur… please teach me

1 Like