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 applePay() { | |
let request = PKPaymentRequest() | |
request.merchantIdentifier = "merchant.tw.archie" | |
request.merchantCapabilities = .capability3DS | |
request.countryCode = "US" | |
request.currencyCode = "USD" | |
request.supportedNetworks = [.visa] | |
request.paymentSummaryItems = [PKPaymentSummaryItem.init(label: "Archie's shake hand", amount: 2000, type: .final)] | |
request.shippingType = .storePickup | |
let contact = PKContact() |
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
from apns import ApnsPusher | |
ApnsPusher().push("Test Title", "Test Body", "device token", False) |
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
cryptography | |
pyjwt | |
hyper |
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
let notification = UILocalNotification() | |
notification.alertAction = "推播滑動的動作名稱" | |
notification.alertBody = "推播的內容" | |
notification.alertTitle = "推播的標題" | |
notification.soundName = UILocalNotificationDefaultSoundName | |
// 觸發條件以使用者的位置為主 | |
let region = CLCircularRegion(center: center, radius: radius, identifier: ID) | |
// 可以設定當使用者進入或離開區域的時候,是否要跳出通知 | |
region.notifyOnExit = false | |
region.notifyOnEntry = 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
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd, didRewardUserWith reward: GADAdReward) { | |
//give user reward | |
} | |
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd, didFailToLoadWithError error: Error) { | |
print("Reward based video ad failed to load: \(error.localizedDescription)") | |
} | |
func rewardBasedVideoAdDidReceive(_ rewardBasedVideoAd: GADRewardBasedVideoAd) { | |
print("Reward based video ad is received.") |
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 GADRewardBasedVideoAd.sharedInstance().isReady { | |
GADRewardBasedVideoAd.sharedInstance().present(fromRootViewController: self) | |
} else { | |
//do something | |
} |
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 loadAdMob() { | |
GADRewardBasedVideoAd.sharedInstance().delegate = self | |
let request = GADRequest() | |
GADRewardBasedVideoAd.sharedInstance().load(request, withAdUnitID: AdUnitID) | |
} |
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
import Firebase | |
import GoogleMobileAds | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
FirebaseApp.configure() | |
GADMobileAds.configure(withApplicationID: Your_Ads_ApplicationID) | |
return 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
pod 'Firebase/AdMob' |
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 setUpView() { | |
let loginButton = CircleButton() | |
loginButton.backgroundColor = UISetting.blue | |
} |