Skip to content
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

[Tracking] Import phonebook contacts into New Expensify #47938

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

[Tracking] Import phonebook contacts into New Expensify #47938

roryabraham opened this issue Aug 23, 2024 · 113 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: @DylanDylann
@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
@blimpich blimpich removed Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Jan 3, 2025
@blimpich blimpich changed the title [HOLD for payment 2025-01-02] [HOLD for payment 2024-12-25] [Tracking] Import phonebook contacts into New Expensify [Tracking] Import phonebook contacts into New Expensify Jan 3, 2025
@blimpich
Copy link
Contributor

blimpich commented Jan 3, 2025

Update:

After being reverted we have a PR up but we're waiting for @perunt to be added to the Mobile Expensify Repo so that we can thoroughly test the PR to ensure it doesn't break HybridApp. There is an open issue tracking adding new devs to the Mobile-Expensify repo here. Progress has been slow since lots of people are out for holidays.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Jan 6, 2025
@perunt
Copy link
Contributor

perunt commented Jan 6, 2025

@blimpich the Contact Module has been successfully reapplied. Additionally I've bumped Nitro.
Since I still don't have access to the Hybrid App, could you please assign someone who can run it? Thanks!

@blimpich
Copy link
Contributor

blimpich commented Jan 7, 2025

Reached out to engineers familiar with hybrid app here: https://expensify.slack.com/archives/C04878MDF34/p1736210982318679.

@Julesssss Julesssss reopened this Jan 7, 2025
@Julesssss
Copy link
Contributor

Hey @blimpich, @staszekscp submitted a promising-looking PR for resolving issues here, which was just merged 🎉

@github-project-automation github-project-automation bot moved this from In Progress to Done in [#whatsnext] #convert Jan 7, 2025
@blimpich
Copy link
Contributor

blimpich commented Jan 9, 2025

@perunt can you look at the most recent comments on the PR and merge in main? I think we're about ready to merge again.

@blimpich
Copy link
Contributor

@DylanDylann are you able to test the PR for hybrid app compatibility? #54459

@DylanDylann
Copy link
Contributor

@blimpich I am trying to setup a hybrid app locally. Could we build ad-hoc for hybrid App?

@blimpich
Copy link
Contributor

Update: both @DylanDylann and @perunt should have access to hybrid app now, which should make it easier to iron out the last few issues we are seeing with the contacts module PR.

@blimpich
Copy link
Contributor

Update

Everyone on this issue has access to the hybrid-app now. @perunt is working on fixing build issues in this PR.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Feb 24, 2025
Copy link

melvin-bot bot commented Feb 24, 2025

This issue has not been updated in over 15 days. @shawnborton, @blimpich, @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!

@perunt
Copy link
Contributor

perunt commented Feb 24, 2025

All good, Melvin. A few days ago, I checked the PR, and it works for HybridApp, so I requested a review on it: #54459 (comment)

@blimpich
Copy link
Contributor

@DylanDylann do you have an ETA on when you'll be able to give the new PR a review?

@roryabraham roryabraham self-assigned this Feb 25, 2025
@roryabraham
Copy link
Contributor Author

rejoining the fray as a reviewer here now that I'm back from parental leave

@DylanDylann
Copy link
Contributor

I will try to complete my review today

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