This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.colorTheme": "Stripe Docs Blue", | |
"telemetry.enableTelemetry": false, | |
"terminal.integrated.fontFamily": "Hack Nerd Font Mono", | |
"terminal.integrated.fontSize": 13, | |
"terminal.integrated.fontWeight": 1000, | |
"editor.fontWeight": 500, | |
"editor.fontSize": 13, | |
"editor.fontFamily": "Jetbrains Mono", | |
"editor.fontLigatures": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ShopifyAuth.swift | |
// | |
// Created by David Muzi on 2020-05-15. | |
// | |
// https://shopify.dev/tutorials/authenticate-with-oauth | |
import AuthenticationServices | |
struct ShopifyAuth { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JavascriptInterface | |
public void setPrimaryButton(String json) { | |
if (isValidString(json)) { | |
handler.post(() -> delegate.removePrimaryButton()); | |
} else { | |
handler.post(() -> delegate.setPrimaryButton(json)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Mobile = { | |
setPrimaryButton: function(data) { | |
Android.setPrimaryButton(JSON.stringify(data)); | |
}, | |
setSecondaryButtons: function(data) { | |
Android.setSecondaryButtons(JSON.stringify(data)); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { | |
guard let type = EmbeddedAppMessageType(rawValue: message.name) else { return } | |
switch type { | |
case .setTitle: | |
let title = message.body as? String | |
setTitle(title: title) | |
case .loadingOn: | |
startActivityIndicator(start: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Mobile = { | |
setLoadingOn: function() { | |
window.webkit.messageHandlers.loadingOn.postMessage(null) | |
}, | |
setLoadingOff: function() { | |
window.webkit.messageHandlers.loadingOff.postMessage(null) | |
}, | |
setTitle: function(title) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!this['__extension']) { | |
this['__extension'] = Shopify.EmbeddedApp.extend({ | |
'Shopify.API.Bar.loading.on': function(data, next) { | |
Mobile.setLoadingOn(); | |
}, | |
'Shopify.API.Bar.loading.off': function(data, next) { | |
Mobile.setLoadingOff(); | |
}, |