Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Support MetaMask mobile #296

Merged

Conversation

filmerjarred
Copy link
Contributor

@filmerjarred filmerjarred commented Mar 18, 2020

Fix for #288 to support the new ethereum provider api

@CLAassistant
Copy link

CLAassistant commented Mar 18, 2020

CLA assistant check
All committers have signed the CLA.

@filmerjarred
Copy link
Contributor Author

Old
2020-03-18 19_21_56-DevTools - colony io_connect

New
2020-03-18 19_19_01-DevTools - 81f35b7c ngrok io_

@rdig rdig requested a review from chmanie March 19, 2020 10:58
@rdig rdig added the feature label Mar 19, 2020
@chmanie
Copy link
Member

chmanie commented Mar 19, 2020

Hey @BrighTide! That looks really great! Would you do me a favour and rebase your PR on the current master? We'll then proceed on testing it

@chmanie
Copy link
Member

chmanie commented Mar 19, 2020

Oh, sorry to be picky here but could you please rebase instead of merging upstream? We like to keep our git trees tidy :)

@filmerjarred
Copy link
Contributor Author

Ha, don't worry I appreciate keeping things tidy. Just having a little trouble navigating rebasing from a fork. Good chance to read up on my gitfu

@chmanie
Copy link
Member

chmanie commented Mar 19, 2020

I think it might even make sense to squash all your commits into one.

@filmerjarred filmerjarred force-pushed the feature/288-support-metamask-mobile branch 2 times, most recently from cd0dfc4 to fc223aa Compare March 19, 2020 12:32
@filmerjarred
Copy link
Contributor Author

Ok, went through the rebase and git log seems to think my four commits are the most recent so I think we're good?

@filmerjarred
Copy link
Contributor Author

I think it might even make sense to squash all your commits into one.

Ah sorry just saw this, still want me to squash them?

@chmanie
Copy link
Member

chmanie commented Mar 19, 2020

Ah, no, it's fine. Maybe just squash the commits in which the package.json was changed (48a0644) with the yarn.lock changes (fc223aa) (it's always good to have these together).

	- pursuer-metamask was failing on mobile
	- Mobile version of metamask had etherum provider with new api
	- Re-implemented code to get the address and listen for account changes
@filmerjarred filmerjarred force-pushed the feature/288-support-metamask-mobile branch from fc223aa to ce051cb Compare March 19, 2020 22:45
Copy link
Member

@chmanie chmanie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all fine, except for the minor comment there. Please remove the vscode settings and use the newest version of cross-env, then we're good :)

@@ -0,0 +1,4 @@
{
"typescript.validate.enable": false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would like to be agnostic about any IDE, so I'd appreciate if you didn't check in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken care of 👍

package.json Outdated
"regenerator-runtime": "0.13.5"
"regenerator-runtime": "0.13.5",
"rimraf": "^3.0.2",
"cross-env": "^6.0.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can actually use the newest version now. We upgraded node to v10.x

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not upgraded :)

@rdig rdig changed the title Feature/288 support metamask mobile Support MetaMask mobile Mar 23, 2020
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected. Very nice work 💯

Here's some screenshots from running this on our QA server:

We've released an rc from your branch:
Screenshot_20200323-172706

Calling the signMessage method:
Screenshot_20200323-172715

The actual prompt from MetaMask Mobile:
Screenshot_20200323-172722

The resulting message signature (Part of it hidden)
Screenshot_20200323-172727

Thank you for your contribution @BrighTide !

const ethereum = metamaskHelpers.getInpageProvider();

if (ethereum.on) {
ethereum.on('accountsChanged', observer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -15,7 +16,7 @@ if (process.env.NODE_ENV === 'production') {
/*
* Clean the build folder before building
*/
const squeakyClean = buildFolder => run(`rm -rf ${buildFolder}`, {}, false);
const squeakyClean = buildFolder => rimraf.sync(buildFolder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, right.

When I first set this up, I never gave any thoughts to non-unix systems

@chmanie
Copy link
Member

chmanie commented Mar 23, 2020

Hey @BrighTide, would you mind posting your address here, that you are using in the colony so that we can release your bounty once we've merged this? Cheers!

@filmerjarred
Copy link
Contributor Author

No worries :) "0x5D748885F040d45439Bfe4e463b271E4180937D1"

@chmanie
Copy link
Member

chmanie commented Mar 25, 2020

Fantastic! Merging and releasing the payout!

@chmanie chmanie merged commit fb5d886 into JoinColony:master Mar 25, 2020
@chmanie chmanie mentioned this pull request Apr 14, 2020
1 task
@rdig rdig mentioned this pull request Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants