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

[HOLD for payment 2025-01-02] [HOLD for payment 2024-12-25] [Tracking] Import phonebook contacts into New Expensify #47938

Open
roryabraham opened this issue Aug 23, 2024 · 98 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Design NewFeature Something to build that is a new item. 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: @zanyrenney
@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
@Julesssss
Copy link
Contributor

I think you're good to go now. Please make sure this is tested locally against HybridApp builds though, as any new issues with the build process could block App development just as we are OOO for the holidays.

@perunt
Copy link
Contributor

perunt commented Dec 17, 2024

I've tested it on my end. @DylanDylann also finished his testing. So I think we're good to go, @blimpich.

@blimpich
Copy link
Contributor

blimpich commented Dec 17, 2024

I have to wait to merge unfortunately. We're having a fire right now related to our hybrid app (just sprung up this morning) and merging a big PR is likely going to get reverted again. I'll try to get it in this week and confirm that it won't get reverted again, but probably won't happen today.

@perunt
Copy link
Contributor

perunt commented Dec 17, 2024

By the way, I’d be happy to help with this as well. We have some extra cycles at Margelo, so feel free to reach out if you need anything!

@blimpich
Copy link
Contributor

Merged again. Hoping this time nothing happens to get it reverted 🤞🍀

@Julesssss
Copy link
Contributor

Merged again. Hoping this time nothing happens to get it reverted 🤞🍀

Hey all, I just wanted to check this was tested on HybridApp iOS and Android?

@DylanDylann
Copy link
Contributor

As C reviewer, I only test on Newdot

@perunt
Copy link
Contributor

perunt commented Dec 19, 2024

Hey @Julesssss
I don’t have access to the hybrid app repo yet. Maybe I can run it through a GitHub Action and test it out?

@zanyrenney
Copy link
Contributor

Hey Ben, can you let me know what the updated payment date should be on this if it was reverted? @blimpich

@blimpich
Copy link
Contributor

Hey all, I just wanted to check this was tested on HybridApp iOS and Android?

It was not, sorry @Julesssss I completely blanked on checking that 😞. You very clearly asked to have us check that, that is 100% my bad.

Hey Ben, can you let me know what the updated payment date should be on this if it was reverted?

@zanyrenney if this doesn't get reverted again (it might), then December 25th would be the pay out date I believe.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 20, 2024
Copy link

melvin-bot bot commented Dec 20, 2024

Payment Summary

Upwork Job

  • Contributor: @perunt is from an agency-contributor and not due payment
  • ROLE: @DylanDylann paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@zanyrenney)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@WoLewicki
Copy link
Contributor

It was not, sorry @Julesssss I completely blanked on checking that 😞. You very clearly asked to have us check that, that is 100% my bad.

Yeah the problem is that it's not compatible with Hybrid App right now and it might not be too easy to fix since we don't have much knowledge of the internals of Nitro Modules. We'll try to make it work though 🚀

@Julesssss
Copy link
Contributor

Yeah it's pretty difficult for anyone to test right now. Especially just after the submodule change and other build issues 😭

@zanyrenney zanyrenney changed the title [HOLD for payment 2024-12-20] [Tracking] Import phonebook contacts into New Expensify [HOLD for payment 2024-12-25] [Tracking] Import phonebook contacts into New Expensify Dec 20, 2024
@blimpich
Copy link
Contributor

@zanyrenney we ended up reverting again fyi.

@perunt @DylanDylann work is being done to make it so that you can test Hybrid App in the near future, but lots of Expensify Engineers are taking time off this time of year so we might have to wait till January. We're close to getting working ad-hoc builds here, so hopefully that can be used soon.

Will keep you updated on adding you to the Mobile-Expensify repo. Takes time. We're revamping some internal processes to make this easier in the future. Sorry about all the reverts 😢

@perunt no rush, but when you get a chance can you re-raise the PR?

In the meantime, I'm going to change this to weekly cadence.

@blimpich blimpich added Weekly KSv2 and removed Daily KSv2 labels Dec 21, 2024
@perunt
Copy link
Contributor

perunt commented Dec 23, 2024

Okay, I'm going to open it again. It's funny how many times it has been reverted, especially since there's no direct issue with the PR 🥲
This time, we’ll definitely get it merged 😸

Will keep you updated on adding you to the Mobile-Expensify repo. Takes time. We're revamping some internal processes to make this easier in the future. Sorry about all the reverts 😢

It will make things easier, thank you!

@blimpich blimpich removed the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 25, 2024

Payment Summary

Upwork Job

  • Contributor: @perunt is from an agency-contributor and not due payment
  • ROLE: @DylanDylann paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@zanyrenney)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 26, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-12-25] [Tracking] Import phonebook contacts into New Expensify [HOLD for payment 2025-01-02] [HOLD for payment 2024-12-25] [Tracking] Import phonebook contacts into New Expensify Dec 26, 2024
Copy link

melvin-bot bot commented Dec 26, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-01-02. 🎊

For reference, here are some details about the assignees on this issue:

  • @perunt does not require payment (Contractor)
  • @DylanDylann requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 26, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@DylanDylann] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Design NewFeature Something to build that is a new item. Weekly KSv2
Projects
Status: In Progress
Development

No branches or pull requests