# How can i use II in android or IOS native env?

**URL:** <https://forum.dfinity.org/t/how-can-i-use-ii-in-android-or-ios-native-env/22013>\
**Category:** Developers\
**Tags:** Discussing, internet-identity\
**Created:** [August 8, 2023, 2:55pm UTC](https://forum.dfinity.org/t/how-can-i-use-ii-in-android-or-ios-native-env/22013 "2023-08-08T14:55:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![famouscat8](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/famouscat8/32/4732_2.png) [@famouscat8](https://forum.dfinity.org/u/famouscat8)\
**Post date:** [August 8, 2023, 2:55pm UTC](https://forum.dfinity.org/t/how-can-i-use-ii-in-android-or-ios-native-env/22013/1 "2023-08-08T14:55:51Z")

</div>

I want to build a app where my users can natively use the same `Principal` as my website from `Internet Identity`. Can i do this?  
I found some tutorial in google’s Android website. It says that app can use that same webauthn credential in some situations.

[Sign in your user with Credential Manager | Android Developers](https://developer.android.com/training/sign-in/passkeys)

---

<div class="post-metadata">

**Author:** ![anon74414410](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon74414410](https://forum.dfinity.org/u/anon74414410)\
**Post date:** [August 8, 2023, 9:59pm UTC](https://forum.dfinity.org/t/how-can-i-use-ii-in-android-or-ios-native-env/22013/2 "2023-08-08T21:59:21Z")

</div>

In order for this to happen, you’ll need two things:

- The same “target” identity in both your website and your app
- The ability to delegate to your website via the browser + webauthn, and then to pass that delegation back to your app.

By default, the auth client will generate an `ECDSAKeyIdentity` for your user if none is available. This won’t serve your purposes, since that API makes it non-exportable.

Instead, you will want to create your shared identity first (maybe using a seed phrase with `Secp256k1KeyIdentity`) and then pass that during `AuthClient.create({identity})`

---

<div class="post-metadata">

**Author:** ![frederikrothenberger](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/frederikrothenberger/32/3826_2.png) [@frederikrothenberger](https://forum.dfinity.org/u/frederikrothenberger)\
**Post date:** [August 9, 2023, 7:07am UTC](https://forum.dfinity.org/t/how-can-i-use-ii-in-android-or-ios-native-env/22013/3 "2023-08-09T07:07:50Z")

</div>

Hi @famouscat8

Yes, this is possible. You can take a look at the [example here](https://github.com/dfinity/examples/tree/master/motoko/ios-notifications), to see how to integrate a native iOS app with Internet Identity.

Since you need to delegate to the browser anyway for the authentication flow, you just need to make sure that you use the same domain in both instances (or make use of the [alternative origins feature](https://internetcomputer.org/docs/current/references/ii-spec#alternative-frontend-origins)).

Note that your service does _not_ interact with WebAuthn credentials directly, if it authenticates via II (in that case II owns the credentials).
