Skip to content

Conversation

richherrera
Copy link
Contributor

@richherrera richherrera commented Mar 13, 2025

Summary of changes

  • Add Venmo app install check and pass details to the web SDK
;(function () {
    if (!window.popupBridge) { window.popupBridge = {}; };

    window.popupBridge.getReturnUrlPrefix = function getReturnUrlPrefix() {
        return 'sdk.ios.popup-bridge://popupbridgev1/';
    };
    
    window.popupBridge.isVenmoInstalled = false;
    
    window.popupBridge.open = function open(url) {
        window.webkit.messageHandlers.POPPopupBridge
            .postMessage({
            url: url
        });
    };

    window.popupBridge.sendMessage = function sendMessage(message, data) {
        window.webkit.messageHandlers.POPPopupBridge
            .postMessage({
            message: {
                name: message,
                data: data
            }
        });
    };

    return 0;
})();

README:
Screenshot 2025-03-14 at 10 27 56 a m

Migration guide:
Screenshot 2025-03-14 at 10 27 32 a m

Checklist

  • Added a changelog entry

Authors

@richherrera richherrera requested a review from a team as a code owner March 13, 2025 22:14
@@ -58,5 +58,9 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.venmo.touch.v2</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call this out as a requirement in the README and/or a migration guide if we have one? This check won't work unless merchants register this scheme. Can also add this in the CHANGELOG since it's new functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, i also attached a couple of screenshots

@@ -15,6 +16,8 @@ struct PopupBridgeUserScript {
return '\(scheme)://\(host)/';
};

window.popupBridge.isVenmoInstalled = \(isVenmoInstalled.description);
Copy link
Contributor

Choose a reason for hiding this comment

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

I always find .description a bit of a weird way to represent a string bool. Thoughts on just doing "\(isVenmoInstalled)" here? Take it or leave it, may just be a me problem. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

x2, thanks for the feedback, updated: fdbb9db

@richherrera richherrera self-assigned this Mar 14, 2025
@richherrera richherrera added the v3 label Mar 14, 2025
Copy link
Contributor

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

👏

@richherrera richherrera merged commit 4ed21f3 into v3 Mar 18, 2025
4 checks passed
@richherrera richherrera deleted the add-venmo-install branch March 18, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants