Skip to content

Commit

Permalink
Merge pull request #541 from qonversion/feature/sampleSkipAuth
Browse files Browse the repository at this point in the history
Added option to skip auth
  • Loading branch information
suriksarkisyan authored Sep 10, 2024
2 parents c3391fe + f326217 commit df528fe
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Sample/ActivePermissionsTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ActivePermissionsTableViewCell: UITableViewCell {
@IBOutlet weak var renewStateLabel: UILabel!

func setup(with permission: Qonversion.Entitlement) {
permissionIdLabel.text = "Permission id: \(permission.entitlementID)"
permissionIdLabel.text = "Permission id: \(permission.entitlementID). isActive: \(permission.isActive)"
productIdLabel.text = "Product id: \(permission.productID)"
var renewState = ""
switch permission.renewState {
Expand Down
4 changes: 4 additions & 0 deletions Sample/AuthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class AuthViewController: UIViewController {
}
}

@IBAction func didTapSkipAuth(_ sender: Any) {
showMainScreen()
}

@IBAction func didTouchSignInButton(_ sender: Any) {
let conf = GIDConfiguration(clientID: "11599271839-qalspkpqrihnkl1e12be731tgmre5uop.apps.googleusercontent.com")
GIDSignIn.sharedInstance.signIn(with: conf, presenting: self) { [weak self] user, error in
Expand Down
48 changes: 31 additions & 17 deletions Sample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Ebn-7h-m5V">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Ebn-7h-m5V">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -18,7 +18,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build in-app subscriptions" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4rd-Ug-s4I">
<rect key="frame" x="106" y="231" width="202" height="67"/>
<rect key="frame" x="106" y="235" width="202" height="67"/>
<constraints>
<constraint firstAttribute="width" constant="202" id="WaS-vB-nUr"/>
</constraints>
Expand All @@ -27,14 +27,14 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qonversion_icon" translatesAutoresizingMaskIntoConstraints="NO" id="b5Y-jw-eoO">
<rect key="frame" x="157" y="89" width="100" height="100"/>
<rect key="frame" x="157" y="93" width="100" height="100"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="XGh-xg-nFy"/>
<constraint firstAttribute="height" constant="100" id="yYb-h1-6lj"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="without server code" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0ow-ud-r2G">
<rect key="frame" x="113.5" y="302" width="187" height="24"/>
<rect key="frame" x="113.5" y="306" width="187" height="24"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -86,10 +86,10 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vSs-Ne-zf2">
<rect key="frame" x="0.0" y="326" width="414" height="206"/>
<rect key="frame" x="0.0" y="330" width="414" height="202"/>
<subviews>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="large" translatesAutoresizingMaskIntoConstraints="NO" id="Fcm-9x-hwK">
<rect key="frame" x="188.5" y="104.5" width="37" height="37"/>
<rect key="frame" x="188.5" y="102.5" width="37" height="37"/>
</activityIndicatorView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
Expand Down Expand Up @@ -128,7 +128,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GDR-fR-MEn">
<rect key="frame" x="314" y="89" width="68" height="30"/>
<rect key="frame" x="314" y="93" width="68" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="68" id="kYc-qt-bH3"/>
</constraints>
Expand Down Expand Up @@ -196,11 +196,11 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="ifg-be-QCC">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<rect key="frame" x="0.0" y="48" width="414" height="814"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ActivePermissionsTableViewCell" rowHeight="143" id="0an-eY-haS" customClass="ActivePermissionsTableViewCell" customModule="Sample" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="414" height="143"/>
<rect key="frame" x="0.0" y="50" width="414" height="143"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="0an-eY-haS" id="FK1-6g-MDh">
<rect key="frame" x="0.0" y="0.0" width="414" height="143"/>
Expand Down Expand Up @@ -277,7 +277,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qonversion_icon" translatesAutoresizingMaskIntoConstraints="NO" id="uDs-yJ-Ide">
<rect key="frame" x="157" y="133" width="100" height="100"/>
<rect key="frame" x="157" y="137" width="100" height="100"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="VEO-9O-cXK"/>
<constraint firstAttribute="height" constant="100" id="xJa-sI-cfj"/>
Expand All @@ -295,10 +295,10 @@
</connections>
</view>
<view contentMode="scaleToFill" horizontalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="oqt-i4-ZZ7">
<rect key="frame" x="0.0" y="233" width="414" height="434"/>
<rect key="frame" x="0.0" y="237" width="414" height="430"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FFt-Om-ub8">
<rect key="frame" x="20" y="20" width="374" height="394"/>
<rect key="frame" x="20" y="20" width="374" height="390"/>
<string key="text">Welcome to Qonversion sample app.



Please use the sign-in with Google option to test cross-platform subscription management.</string>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
Expand All @@ -314,6 +314,18 @@ Please use the sign-in with Google option to test cross-platform subscription ma
<constraint firstAttribute="trailing" secondItem="FFt-Om-ub8" secondAttribute="trailing" constant="20" id="krE-Kb-pWP"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yke-eJ-N6y">
<rect key="frame" x="129.5" y="746" width="155" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="155" id="Ilz-tm-RZa"/>
<constraint firstAttribute="height" constant="35" id="rlB-MO-07o"/>
</constraints>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Skip"/>
<connections>
<action selector="didTapSkipAuth:" destination="lOC-Q6-7Jo" eventType="touchUpInside" id="Qrq-jo-a0r"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="YJA-BN-Hcz"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
Expand All @@ -322,10 +334,12 @@ Please use the sign-in with Google option to test cross-platform subscription ma
<constraint firstItem="uDs-yJ-Ide" firstAttribute="centerX" secondItem="n1g-cY-bQy" secondAttribute="centerX" id="3GQ-uJ-bce"/>
<constraint firstItem="oqt-i4-ZZ7" firstAttribute="trailing" secondItem="YJA-BN-Hcz" secondAttribute="trailing" id="7HO-XO-1SN"/>
<constraint firstItem="oqt-i4-ZZ7" firstAttribute="top" secondItem="uDs-yJ-Ide" secondAttribute="bottom" id="DsI-S4-3jd"/>
<constraint firstItem="yke-eJ-N6y" firstAttribute="top" secondItem="Ltg-vY-Erk" secondAttribute="bottom" constant="24" id="Hf4-Jf-ulW"/>
<constraint firstItem="oqt-i4-ZZ7" firstAttribute="leading" secondItem="YJA-BN-Hcz" secondAttribute="leading" id="IF3-TB-cvc"/>
<constraint firstItem="YJA-BN-Hcz" firstAttribute="bottom" secondItem="Ltg-vY-Erk" secondAttribute="bottom" constant="140" id="Umz-gd-gEz"/>
<constraint firstItem="uDs-yJ-Ide" firstAttribute="top" secondItem="YJA-BN-Hcz" secondAttribute="top" constant="45" id="iSF-UT-Gos"/>
<constraint firstItem="Ltg-vY-Erk" firstAttribute="top" secondItem="oqt-i4-ZZ7" secondAttribute="bottom" id="m75-4U-Qsa"/>
<constraint firstItem="yke-eJ-N6y" firstAttribute="centerX" secondItem="n1g-cY-bQy" secondAttribute="centerX" id="ycb-4W-rWe"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="UUW-TN-hGa"/>
Expand All @@ -343,7 +357,7 @@ Please use the sign-in with Google option to test cross-platform subscription ma
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="Ebn-7h-m5V" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="kzY-ZV-U29">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<rect key="frame" x="0.0" y="48" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
Expand All @@ -364,11 +378,11 @@ Please use the sign-in with Google option to test cross-platform subscription ma
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="e60-fs-R7D">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<rect key="frame" x="0.0" y="48" width="414" height="814"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="OfferingsTableViewCell" rowHeight="260" id="XAs-ru-Mmq" customClass="OfferingsTableViewCell" customModule="Sample" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="414" height="260"/>
<rect key="frame" x="0.0" y="50" width="414" height="260"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XAs-ru-Mmq" id="BfF-SR-Wlf">
<rect key="frame" x="0.0" y="0.0" width="414" height="260"/>
Expand Down Expand Up @@ -477,7 +491,7 @@ Please use the sign-in with Google option to test cross-platform subscription ma
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemPurpleColor">
<color red="0.68627450980392157" green="0.32156862745098042" blue="0.87058823529411766" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.68627450980000004" green="0.32156862749999998" blue="0.87058823529999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
Loading

0 comments on commit df528fe

Please sign in to comment.