Skip to content

Commit 9470f07

Browse files
committed
[dev app] add buttons for requiring privacy consent
1 parent 6bbdca6 commit 9470f07

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

iOS_SDK/OneSignalDevApp/OneSignalDevApp/Base.lproj/Main.storyboard

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,33 @@
501501
<fontDescription key="fontDescription" type="system" pointSize="14"/>
502502
<textInputTraits key="textInputTraits"/>
503503
</textField>
504-
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" selected="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xRQ-ep-yvV" userLabel="Clear All Button">
504+
<button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xRQ-ep-yvV" userLabel="Clear All Button">
505505
<rect key="frame" x="140" y="1762" width="148" height="30"/>
506-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
507506
<color key="tintColor" red="1" green="0.1367101157" blue="0.01701983743" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
508507
<state key="normal" title="Clear All Notifications"/>
509508
<connections>
510509
<action selector="clearAllNotifications:" destination="BYZ-38-t0r" eventType="touchUpInside" id="57F-2o-3G8"/>
511510
</connections>
512511
</button>
512+
<button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dlG-XI-zeT">
513+
<rect key="frame" x="115" y="1852" width="145" height="30"/>
514+
<color key="tintColor" red="1" green="0.1367101157" blue="0.01701983743" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
515+
<state key="normal" title="Dont require consent"/>
516+
<connections>
517+
<action selector="dontRequireConsent:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Kjh-GZ-MyL"/>
518+
</connections>
519+
</button>
520+
<button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3fx-6I-1V6">
521+
<rect key="frame" x="107" y="1819" width="161" height="30"/>
522+
<constraints>
523+
<constraint firstAttribute="width" constant="161" id="NnG-7I-PP1"/>
524+
</constraints>
525+
<color key="tintColor" red="1" green="0.1367101157" blue="0.01701983743" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
526+
<state key="normal" title="Require consent"/>
527+
<connections>
528+
<action selector="requireConsent:" destination="BYZ-38-t0r" eventType="touchUpInside" id="vxn-ST-TBu"/>
529+
</connections>
530+
</button>
513531
</subviews>
514532
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
515533
<constraints>
@@ -550,6 +568,7 @@
550568
<constraint firstItem="cWh-Hu-7CP" firstAttribute="top" secondItem="A38-En-69W" secondAttribute="top" id="ET2-Bx-oB2"/>
551569
<constraint firstItem="udx-VH-OPB" firstAttribute="top" secondItem="lEs-as-Xak" secondAttribute="bottom" constant="6" id="EeW-Wz-D7f"/>
552570
<constraint firstItem="XxB-ij-UMV" firstAttribute="centerX" secondItem="6dV-2z-2jJ" secondAttribute="centerX" id="Ek9-He-sk3"/>
571+
<constraint firstItem="3fx-6I-1V6" firstAttribute="top" secondItem="xRQ-ep-yvV" secondAttribute="bottom" constant="27" id="Exy-Tb-dnC"/>
553572
<constraint firstItem="wT0-PD-6z7" firstAttribute="leading" secondItem="Whm-aD-RCM" secondAttribute="leading" constant="-2" id="GCU-dL-7XC"/>
554573
<constraint firstItem="srQ-s9-3O9" firstAttribute="top" secondItem="H7c-2l-Pkl" secondAttribute="bottom" constant="8" id="GjJ-A2-hHZ"/>
555574
<constraint firstItem="L3h-sn-LJN" firstAttribute="top" secondItem="WOr-el-mEb" secondAttribute="bottom" constant="8" id="Gxw-1F-LHM"/>
@@ -567,6 +586,7 @@
567586
<constraint firstItem="rIN-rI-IgX" firstAttribute="top" secondItem="Kp7-Oh-BQ1" secondAttribute="bottom" constant="8" id="NHd-4N-nPN"/>
568587
<constraint firstItem="XxB-ij-UMV" firstAttribute="centerX" secondItem="6dV-2z-2jJ" secondAttribute="centerX" id="Nhz-Hp-pzN"/>
569588
<constraint firstItem="bYz-SP-tnS" firstAttribute="top" secondItem="NdZ-yd-14F" secondAttribute="top" id="Npm-Oe-EfX"/>
589+
<constraint firstAttribute="trailing" secondItem="xRQ-ep-yvV" secondAttribute="trailing" constant="87" id="OSK-7T-X08"/>
570590
<constraint firstItem="a9d-ER-L2X" firstAttribute="top" secondItem="Kp7-Oh-BQ1" secondAttribute="bottom" constant="8" id="Pjf-ZZ-uzK"/>
571591
<constraint firstItem="9Tw-qJ-FVq" firstAttribute="leading" secondItem="Whw-1A-6W0" secondAttribute="leading" id="Pre-Bc-EfC"/>
572592
<constraint firstItem="G56-cW-rWo" firstAttribute="trailing" secondItem="A38-En-69W" secondAttribute="trailing" constant="20" id="QEO-49-idg"/>
@@ -613,8 +633,10 @@
613633
<constraint firstItem="NdZ-yd-14F" firstAttribute="centerX" secondItem="q4D-1P-6cD" secondAttribute="centerX" id="evg-Kp-3gm"/>
614634
<constraint firstItem="htU-cG-NyO" firstAttribute="leading" secondItem="79P-xw-1Q5" secondAttribute="leading" id="gSD-AV-cLt"/>
615635
<constraint firstItem="Whm-aD-RCM" firstAttribute="trailing" secondItem="Ecj-vJ-K60" secondAttribute="trailing" constant="1" id="gic-WK-yi1"/>
636+
<constraint firstAttribute="bottom" secondItem="3fx-6I-1V6" secondAttribute="bottom" constant="651" id="gvp-gJ-TiS"/>
616637
<constraint firstItem="yRP-dg-rBy" firstAttribute="top" secondItem="6dV-2z-2jJ" secondAttribute="top" constant="244" id="hN8-d5-5HN"/>
617638
<constraint firstItem="A38-En-69W" firstAttribute="leading" secondItem="idh-ud-yeY" secondAttribute="leading" id="hOo-6r-9uP"/>
639+
<constraint firstItem="3fx-6I-1V6" firstAttribute="centerX" secondItem="dlG-XI-zeT" secondAttribute="centerX" id="ht7-Ck-Vsl"/>
618640
<constraint firstItem="Ykz-Wq-cb5" firstAttribute="top" secondItem="saG-x9-o6U" secondAttribute="bottom" constant="8" id="hyN-FW-j9s"/>
619641
<constraint firstItem="HVt-vl-fuR" firstAttribute="centerX" secondItem="468-Vy-JbK" secondAttribute="centerX" id="iW2-UF-ypl"/>
620642
<constraint firstItem="NdZ-yd-14F" firstAttribute="leading" secondItem="bYz-SP-tnS" secondAttribute="trailing" constant="15" id="ixw-Sw-MYZ"/>
@@ -639,10 +661,12 @@
639661
<constraint firstItem="H7c-2l-Pkl" firstAttribute="centerX" secondItem="6dV-2z-2jJ" secondAttribute="centerX" id="qAH-t4-Hbo"/>
640662
<constraint firstAttribute="height" constant="2500" id="qKR-2z-UgG"/>
641663
<constraint firstItem="f4C-he-vQl" firstAttribute="leading" secondItem="Whw-1A-6W0" secondAttribute="trailing" constant="16" id="qQa-dC-XOo"/>
664+
<constraint firstItem="3fx-6I-1V6" firstAttribute="centerX" secondItem="L3h-sn-LJN" secondAttribute="centerX" id="qZu-sW-GqU"/>
642665
<constraint firstItem="udx-VH-OPB" firstAttribute="centerX" secondItem="Whm-aD-RCM" secondAttribute="centerX" id="r5m-4t-kSR"/>
643666
<constraint firstItem="mOc-AZ-oON" firstAttribute="top" secondItem="SzM-YZ-1ls" secondAttribute="top" id="sqq-HD-a7j"/>
644667
<constraint firstItem="gZI-5K-94s" firstAttribute="top" secondItem="wT0-PD-6z7" secondAttribute="bottom" constant="8" id="teY-sG-FWL"/>
645668
<constraint firstItem="Ecj-vJ-K60" firstAttribute="top" secondItem="bmb-ib-r40" secondAttribute="bottom" constant="8" id="uFL-iF-4YC"/>
669+
<constraint firstItem="dlG-XI-zeT" firstAttribute="top" secondItem="3fx-6I-1V6" secondAttribute="bottom" constant="3" id="uU3-5S-r0b"/>
646670
<constraint firstItem="H7c-2l-Pkl" firstAttribute="leading" secondItem="6dV-2z-2jJ" secondAttribute="leading" constant="14" id="uXc-mi-LZ9"/>
647671
<constraint firstItem="7ll-OX-6Qj" firstAttribute="centerX" secondItem="6dV-2z-2jJ" secondAttribute="centerX" id="ujG-XB-cbU"/>
648672
<constraint firstItem="05S-ud-V2e" firstAttribute="centerX" secondItem="6dV-2z-2jJ" secondAttribute="centerX" id="vUP-J1-f11"/>

iOS_SDK/OneSignalDevApp/OneSignalDevApp/ViewController.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,14 @@ - (IBAction)clearAllNotifications:(id)sender {
272272
[OneSignal.Notifications clearAll];
273273
}
274274

275+
- (IBAction)requireConsent:(id)sender {
276+
NSLog(@"Dev App: setting setRequiresPrivacyConsent to true.");
277+
[OneSignal setRequiresPrivacyConsent:true];
278+
}
279+
280+
- (IBAction)dontRequireConsent:(id)sender {
281+
NSLog(@"Dev App: setting setRequiresPrivacyConsent to false.");
282+
[OneSignal setRequiresPrivacyConsent:false];
283+
}
284+
275285
@end

0 commit comments

Comments
 (0)