-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix StripeApplePay in App Extensions (#2860)
## Summary Fix StripeApplePay support in App Extensions. ## Motivation #2853 ## Testing Added a Cocoapods test to build an iMessage App Extension with the StripeApplePay SDK. ## Changelog Updated
- Loading branch information
1 parent
bba9f5a
commit 3648ce2
Showing
9 changed files
with
442 additions
and
2 deletions.
There are no files selected for viewing
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
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
228 changes: 227 additions & 1 deletion
228
...nstallation_tests/cocoapods/with_frameworks_swift/CocoapodsTest.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
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
6 changes: 6 additions & 0 deletions
6
...llation_tests/cocoapods/with_frameworks_swift/TestExtension/Assets.xcassets/Contents.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
...works_swift/TestExtension/Assets.xcassets/iMessage App Icon.stickersiconset/Contents.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "60x45" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "60x45" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "67x50" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "74x55" | ||
}, | ||
{ | ||
"idiom" : "ios-marketing", | ||
"scale" : "1x", | ||
"size" : "1024x1024" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"scale" : "2x", | ||
"size" : "27x20" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"scale" : "3x", | ||
"size" : "27x20" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"scale" : "2x", | ||
"size" : "32x24" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"scale" : "3x", | ||
"size" : "32x24" | ||
}, | ||
{ | ||
"idiom" : "ios-marketing", | ||
"platform" : "ios", | ||
"scale" : "1x", | ||
"size" : "1024x768" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...n_tests/cocoapods/with_frameworks_swift/TestExtension/Base.lproj/MainInterface.storyboard
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ObA-dk-sSI"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Messages View Controller--> | ||
<scene sceneID="7MM-of-jgj"> | ||
<objects> | ||
<viewController id="ObA-dk-sSI" customClass="MessagesViewController" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="zMn-AG-sqS"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="528"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hello World" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="d1e-fi-ked"> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<color key="textColor" xcode11CocoaTouchSystemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<constraints> | ||
<constraint firstAttribute="centerY" secondItem="d1e-fi-ked" secondAttribute="centerY" id="H0s-hz-dDP"/> | ||
<constraint firstAttribute="centerX" secondItem="d1e-fi-ked" secondAttribute="centerX" id="wFy-hW-Bib"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="LDy-ih-0nr"/> | ||
</view> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
<size key="freeformSize" width="320" height="528"/> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
</scene> | ||
</scenes> | ||
</document> |
13 changes: 13 additions & 0 deletions
13
Tests/installation_tests/cocoapods/with_frameworks_swift/TestExtension/Info.plist
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionMainStoryboard</key> | ||
<string>MainInterface</string> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.message-payload-provider</string> | ||
</dict> | ||
</dict> | ||
</plist> |
68 changes: 68 additions & 0 deletions
68
...allation_tests/cocoapods/with_frameworks_swift/TestExtension/MessagesViewController.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// MessagesViewController.swift | ||
// TestExtension | ||
// | ||
// Created by David Estes on 8/21/23. | ||
// Copyright © 2023 jflinter. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Messages | ||
import StripeApplePay | ||
|
||
class MessagesViewController: MSMessagesAppViewController { | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
// Do any additional setup after loading the view. | ||
} | ||
|
||
// MARK: - Conversation Handling | ||
|
||
override func willBecomeActive(with conversation: MSConversation) { | ||
// Called when the extension is about to move from the inactive to active state. | ||
// This will happen when the extension is about to present UI. | ||
|
||
// Use this method to configure the extension and restore previously stored state. | ||
} | ||
|
||
override func didResignActive(with conversation: MSConversation) { | ||
// Called when the extension is about to move from the active to inactive state. | ||
// This will happen when the user dismisses the extension, changes to a different | ||
// conversation or quits Messages. | ||
|
||
// Use this method to release shared resources, save user data, invalidate timers, | ||
// and store enough state information to restore your extension to its current state | ||
// in case it is terminated later. | ||
} | ||
|
||
override func didReceive(_ message: MSMessage, conversation: MSConversation) { | ||
// Called when a message arrives that was generated by another instance of this | ||
// extension on a remote device. | ||
|
||
// Use this method to trigger UI updates in response to the message. | ||
} | ||
|
||
override func didStartSending(_ message: MSMessage, conversation: MSConversation) { | ||
// Called when the user taps the send button. | ||
} | ||
|
||
override func didCancelSending(_ message: MSMessage, conversation: MSConversation) { | ||
// Called when the user deletes the message without sending it. | ||
|
||
// Use this to clean up state related to the deleted message. | ||
} | ||
|
||
override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) { | ||
// Called before the extension transitions to a new presentation style. | ||
|
||
// Use this method to prepare for the change in presentation style. | ||
} | ||
|
||
override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) { | ||
// Called after the extension transitions to a new presentation style. | ||
|
||
// Use this method to finalize any behaviors associated with the change in presentation style. | ||
} | ||
|
||
} |