-
Notifications
You must be signed in to change notification settings - Fork 301
Fix account onboarding from PR 2087 #2187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3ec0e2b
0722586
031ad8d
5a34b55
4829ab9
d5b0738
f83fbce
d0ce18a
2a7224c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's cleanup all logs in this file, and the |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| package com.reactnativestripesdk | ||
|
|
||
| import android.app.Activity | ||
| import android.app.Application | ||
| import android.content.ContentProvider | ||
| import android.content.ContentValues | ||
| import android.database.Cursor | ||
| import android.net.Uri | ||
| import android.os.Bundle | ||
| import androidx.activity.ComponentActivity | ||
| import com.stripe.android.connect.EmbeddedComponentManager | ||
|
|
||
| class StripeSdkContentProvider : ContentProvider() { | ||
| override fun onCreate(): Boolean { | ||
| (context?.applicationContext as Application).registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks { | ||
| override fun onActivityCreated( | ||
| activity: Activity, | ||
| savedInstanceState: Bundle? | ||
| ) { | ||
| if (activity is ComponentActivity) { | ||
| EmbeddedComponentManager.onActivityCreate(activity) | ||
| } | ||
| } | ||
|
|
||
| override fun onActivityDestroyed(activity: Activity) { | ||
| } | ||
|
|
||
| override fun onActivityPaused(activity: Activity) { | ||
| } | ||
|
|
||
| override fun onActivityResumed(activity: Activity) { | ||
| } | ||
|
|
||
| override fun onActivitySaveInstanceState( | ||
| activity: Activity, | ||
| outState: Bundle | ||
| ) { | ||
| } | ||
|
|
||
| override fun onActivityStarted(activity: Activity) { | ||
| } | ||
|
|
||
| override fun onActivityStopped(activity: Activity) { | ||
| } | ||
|
|
||
| }) | ||
| return true | ||
| } | ||
|
|
||
| override fun query( | ||
| p0: Uri, | ||
| p1: Array<out String?>?, | ||
| p2: String?, | ||
| p3: Array<out String?>?, | ||
| p4: String? | ||
| ): Cursor? = null | ||
|
|
||
| override fun getType(p0: Uri): String? = null | ||
|
|
||
| override fun insert(p0: Uri, p1: ContentValues?): Uri? = null | ||
|
|
||
| override fun delete( | ||
| p0: Uri, | ||
| p1: String?, | ||
| p2: Array<out String?>? | ||
| ): Int = 0 | ||
|
|
||
| override fun update( | ||
| p0: Uri, | ||
| p1: ContentValues?, | ||
| p2: String?, | ||
| p3: Array<out String?>? | ||
| ): Int = 0 | ||
| } |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same. Please cleanup logs, unless @gimenete-stripe wants to keep some of them. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { useStripe } from '@stripe/stripe-react-native'; | ||
| import Button from '../components/Button'; | ||
| import PaymentScreen from '../components/PaymentScreen'; | ||
|
|
||
| export default function AccountOnboardingScreen() { | ||
| const { presentAccountOnboardingScreen } = useStripe(); | ||
| return ( | ||
| <PaymentScreen> | ||
| <Button | ||
| variant="primary" | ||
| onPress={async () => { | ||
| const result = await presentAccountOnboardingScreen({}); | ||
|
|
||
| console.log('result', result.error); | ||
| }} | ||
| title="Present onboarding screen" | ||
| /> | ||
| </PaymentScreen> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's cleanup logs in this file. I don't think they are valuable.