Skip to content

[Tracking] Import phonebook contacts into New Expensify #47938

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

Open
roryabraham opened this issue Aug 23, 2024 · 125 comments
Open

[Tracking] Import phonebook contacts into New Expensify #47938

roryabraham opened this issue Aug 23, 2024 · 125 comments
Assignees
Labels
Design NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2

Comments

@roryabraham
Copy link
Contributor

roryabraham commented Aug 23, 2024

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 📈. 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. 👥

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 📕 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.

Issue OwnerCurrent Issue Owner: @perunt
@roryabraham roryabraham added the Weekly KSv2 label Aug 23, 2024
@roryabraham roryabraham self-assigned this Aug 23, 2024
@roryabraham roryabraham moved this from Polish to Release 3: Autumn 2024 (Nov) in [#whatsnext] #wave-collect Aug 23, 2024
@roryabraham
Copy link
Contributor Author

First predesign questions:

  • How should we show these?

    • I suggest we just show a new section in selection lists titled Invite to Expensify, styled the same as the existing Recents and Contacts sections:
    image
  • Should we try to support web?

    • I suggest no (for the V1, anyways). There's an experimental ContactsManager web API, but it only works on Android atm. Furthermore, it doesn't support importing all contacts and displaying them using our own UI. Instead, it's more like what we have in OldApp that pulls up the native contacts app and allows you to select contacts to import.
  • Should we try to support desktop?

    • I suggest yes. It may be a bit involved to set up, but fortunately our needs should be pretty simple. It might look something like this:
      • Use the same Swift code to access contacts on macOS and iOS. CNContactsStore works on both.
      • Use the same C+code on iOS and macOS to create C++ bindings for the swift code
      • (here's where things start to differ) on desktop, create a Node.js addon with JS bindings to the C++/Swift code
      • Require the Node.js addon in desktop/main.ts
      • Use the Electron context bridge to provide a renderer process interface for the Node.js code that can be used to access contacts
  • Should we use a library for this?

    • There are a couple of options, such as react-native-contacts and expo-contacts. However, because the native code should be quite simple and none of the existing solutions support (or would be expected to support) Electron, I suggest we just create our own small library for this.

@roryabraham
Copy link
Contributor Author

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

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

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
@trjExpensify
Copy link
Contributor

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

@roryabraham
Copy link
Contributor Author

Moved to #f1-25june2025

@melvin-bot melvin-bot bot removed the Overdue label Sep 2, 2024
@roryabraham
Copy link
Contributor Author

@roryabraham
Copy link
Contributor Author

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

  • When revealing users imported from contacts which aren't yet an Expensify contact, we'll show them just like any other user. We won't draw any additional attention to the fact that they don't yet have an Expensify account, and won't introduce a new Invite section to selection lists
  • Every time SelectionList mounts, we'll:
    • verify we have permission to access contacts.
      • If the user has given permission to access contacts, proceed to the next step.
      • unless the user has explicitly denied permission, request permission to access contacts, then proceed to the next step
    • import all phonebook contacts, include them in the SelectionList result set
  • If a user has explicitly denied permission to access contacts, and have entered a search query which yields no results, then instead of simply showing No results found, we would show:
    Not seeing who you're looking for? Want to [import your phonebook contacts](link)?
  • Only iOS and Android are in-scope for the V1. I think the V2 can target desktop as well, maybe web in a (distant) V3 if the web API improves.
  • We should show a user's contact photo when searching for them and they don't yet an Expensify account.
  • If they do have an Expensify account, but their Expensify account is using a default avatar, and your phonebook contact has an avatar for them, then we should show your phonebook avatar for the user rather than their default Expensify avatar
  • Let's also roll-our-own small amount of native code for this directly in E/App rather than using or publishing a separate package. Let's use Nitro Modules for this native code.

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2024
@roryabraham
Copy link
Contributor Author

@melvin-bot melvin-bot bot removed the Overdue label Sep 19, 2024
@perunt
Copy link
Contributor

perunt commented Sep 23, 2024

👋🏻

@s77rt
Copy link
Contributor

s77rt commented Sep 24, 2024

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

@blimpich blimpich self-assigned this Sep 26, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 4, 2024
@blimpich
Copy link
Contributor

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 14, 2024
@perunt
Copy link
Contributor

perunt commented Oct 15, 2024

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
Copy link
Contributor

Sounds great! Thank you for the update 👍

@perunt perunt mentioned this issue Oct 17, 2024
50 tasks
@DylanDylann
Copy link
Contributor

I will try to complete my review today

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Mar 24, 2025
Copy link

melvin-bot bot commented Mar 24, 2025

This issue has not been updated in over 15 days. @shawnborton, @blimpich, @roryabraham, @perunt, @zanyrenney, @DylanDylann eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Mar 24, 2025
@blimpich blimpich added Weekly KSv2 and removed Monthly KSv2 labels Mar 24, 2025
@blimpich
Copy link
Contributor

Update:

See PR, @perunt is actively working on this.

@blimpich
Copy link
Contributor

@perunt can you provide an update here?

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Apr 17, 2025
Copy link

melvin-bot bot commented Apr 17, 2025

This issue has not been updated in over 15 days. @shawnborton, @blimpich, @roryabraham, @perunt, @zanyrenney, @DylanDylann eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@blimpich blimpich added Weekly KSv2 and removed Monthly KSv2 labels Apr 17, 2025
@blimpich
Copy link
Contributor

@perunt can you provide an update here?

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Apr 22, 2025
@perunt
Copy link
Contributor

perunt commented Apr 22, 2025

@blimpich just resolved all conflicts altogether with the new ESLint rules and Rory's comments. So now it's good to go

@blimpich
Copy link
Contributor

blimpich commented Apr 22, 2025

@perunt thank you! Just re-requested reviews from @DylanDylann and @roryabraham 👍

@melvin-bot melvin-bot bot removed the Weekly KSv2 label May 16, 2025
Copy link

melvin-bot bot commented May 16, 2025

This issue has not been updated in over 15 days. @shawnborton, @blimpich, @roryabraham, @perunt, @zanyrenney, @DylanDylann eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label May 16, 2025
@blimpich blimpich added Weekly KSv2 and removed Monthly KSv2 labels May 16, 2025
@blimpich
Copy link
Contributor

Update

Progress is being made. PR is approved by C+. We're working on getting QA to do a regression suite on this and then also having robust test steps for it (link).

@roryabraham
Copy link
Contributor Author

about a dozen bugs were found during regression testing. QA steps and new TCs have not been added yet

@perunt
Copy link
Contributor

perunt commented May 20, 2025

QA steps are there
I'm going to resolve these bug reports

@perunt
Copy link
Contributor

perunt commented May 20, 2025

I reviewed bugs and almost all of them came from the main branch and disappeared after the merge
The only thing that is left is this stuff (1 and 11 bug) that I want to hear your opinion on @roryabraham

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design NewFeature Something to build that is a new item. Reviewing Has a PR in review Weekly KSv2
Projects
Development

No branches or pull requests