Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.55k stars 2.89k forks source link

[Tracking] Import phonebook contacts into New Expensify #47938

Open roryabraham opened 2 months ago

roryabraham commented 2 months ago

Proposal: Import phonebook contacts into New Expensify

Strategy The most important metric we want to see grow in the coming months is new user acquisition :chart_with_upwards_trend:. To facilitate that we need to invest in features that streamline viral user growth and make it easier to pull new users into the app. :busts_in_silhouette:

Problem If you want to use the Expensify Classic app to invite your team or your boss to Expensify, it’s very easy. You sign up, scan a receipt, and an inbox task will appear asking who you want to send it to. If you click on that, it will open your phone’s contact book and allow you to select the contact(s) that you want to invite to Expensify. You can invite people you know in just a few taps, without leaving the app.

There are a number of other places throughout Expensify Classic where you can easily invite people to Expensify, such as when submitting reports.

Meanwhile, in New Expensify, the first few steps of inviting new users are arguably more streamlined. You immediately scan a receipt, and on the very next page you’ll be asked who you want to share it with. However, at that stage, you need to leave the app to find their email or phone number from some other source and manually type or copy/paste it into NewDot. This introduces friction in a critical viral growth moment.

Solution Let’s close the gap on one of the final pieces of feature parity between Expensify Classic (mobile) and NewDot, by importing contacts from your phonebook :closed_book: into New Expensify. This will streamline the process of inviting people you already know into Expensify. Let’s show these imported contacts in any page where we invite new users (start chat, workspace invite, request money participants page, etc…).

All these pages are already set up to invite new users to Expensify via their email or phone number, so the only requirement is to import that information from the contacts app (after obtaining the user’s permission to do so). Because of that, this project is completely front-end and self-contained. That means that after we get through an initial high-level design phase, it can be implemented entirely by external contributors.

For UI inspiration, WhatsApp 📞 shows imported contacts in an “Invite to WhatsApp” section.

roryabraham commented 2 months ago

First predesign questions:

roryabraham commented 2 months ago

posted first predesign (saving library/implementation details for a 2nd predesign):

https://expensify.slack.com/archives/C01GTK53T8Q/p1724440169163019

trjExpensify commented 2 months ago

Posted here, but I don't think this is a project for #wave-collect.

roryabraham commented 2 months ago

Moved to #f1-25june2025

roryabraham commented 2 months ago

Predesigns two and three:

roryabraham commented 2 months ago

Summarizing all of our predesign decisions and getting this ready for handoff:

roryabraham commented 1 month ago

last slack update: https://expensify.slack.com/archives/C035J5C9FAP/p1726770468190059?thread_ts=1725380343.339199&cid=C035J5C9FAP

perunt commented 1 month ago

👋🏻

s77rt commented 1 month ago

You can use https://github.com/s77rt/react-native-contacts (a Turbo Module) for reference

blimpich commented 4 weeks ago

@perunt how is the PR going? Can you you give us an update?

perunt commented 4 weeks ago

hey @blimpich, we just finished fixing the Nitro issue (the library we use for this module). Tomorrow, I'm going to show some metrics about it and move that module to the Expensify repo

blimpich commented 4 weeks ago

Sounds great! Thank you for the update 👍

perunt commented 3 weeks ago

You can use https://github.com/s77rt/react-native-contacts (a Turbo Module) for reference

Thanks for the link! I'll use it for an approximate comparison between NitroModule and TurboModule

perunt commented 2 weeks ago

While this isn't the perfect comparison since both modules are built differently under the hood and could probably be optimized further, it gives us a decent starting point. I ran some tests importing around 1,100 contacts - did it 20 times with 10-second breaks between runs to get the average times. Maybe we don't have huge differences, but we definitely see the cost of overhead.

iPhone XR Samsung S21

Nitro is running about 30% faster on iOS and 10-20% faster on Android compared to TurboModules

Since we're getting responses under 100ms, it's actually faster than receiving data from the internet (at least for importing 1k contacts) - it allows us to work without using fetch from the backend (in case when we save it).

mrousavy commented 1 week ago

woohooooo!!! huge 🔥

shubhamguptadream11 commented 1 week ago

@perunt Can you share the nitro module repo link where you did the benchmarks.

melvin-bot[bot] commented 1 week ago

📣 @shubhamguptadream11! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
perunt commented 1 week ago

@shubhamguptadream11 this was my sandbox, link I will update and clean it later, and add screenshots to that repo

perunt commented 1 week ago

I'm adding the last features - 'use photo from contact book for contacts from Expensify that don't have an avatar.' The second ability is that when you pick a user from contacts, you create this user for the Expensify account. Due to our current structure, it's a bit tricky to use the photo for creating this contact on the next screen. I mean to port this photo. Apart from this, everything is working. So I'm starting to think if we need to deliver it in one PR or maybe spread it. I know that if you check the amount of code, it would be around 50k lines, but I want to say that 95% is auto-generated code. I'll also mention this in the PR for reviewer. What do you think? @blimpich (I mean deliver it as one PR or spread it)

blimpich commented 1 week ago

@perunt I think splitting it up is a good idea. I think if that functionality is particularly tricky, it's preferable to break it up so that we can review and test separately. We would just use one of the randomly picked default avatars instead of the contact photo in the first PR correct?

blimpich commented 1 day ago

Not overdue. I see recent progress made on the PR. @perunt any updates to share? Did you decide to split the functionality into multiple PRs like you suggested here?

perunt commented 1 day ago

@blimpich, it's good for review. We may need to change the view of two buttons. I'll ping the design team

DylanDylann commented 7 hours ago

@perunt @blimpich Do we support this feature on mWeb?

melvin-bot[bot] commented 26 minutes ago

Triggered auto assignment to @shawnborton (Design), see these Stack Overflow questions for more details.