Skip to content

Instantly share code, notes, and snippets.

View mobilequickie's full-sized avatar

Mobile Quickie mobilequickie

View GitHub Profile
@mobilequickie
mobilequickie / aws-cli-pinpoint-endpoint-update
Created September 20, 2018 17:43
AWS CLI command to update Amazon Pinpoint endpoint
aws pinpoint update-endpoint \
--application-id "a440cd17fe2b44a8b598f7xxxxxxxxxx" \
--endpoint-id "F2115F34-F064-4AB6-8621-XXXXXXXXXXXX" \
--endpoint-request file://endpointrequest.json
@mobilequickie
mobilequickie / info.plist.xml
Created October 11, 2018 16:08
Facebook Login metadata for Info.plist on iOS
<!-- START OF FACEBOOK PLIST ENTRIES HERE -->
<key>FacebookAppID</key>
<string>1234567891234567</string>
<key>FacebookDisplayName</key>
<string>Auth Demo</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
@mobilequickie
mobilequickie / AuthUIViewController.swift
Created October 11, 2018 16:17
AWS Mobile SDK AuthUI code snippet for main ViewController. This is the same for User Pools, Facebook, and Google sign-in.
import UIKit
import AWSAuthCore
import AWSAuthUI
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
showSignIn()
@mobilequickie
mobilequickie / AWSMobileClient-AppDelegate.swift
Created October 11, 2018 16:23
This is a sample AppDelegate with the required three code snippets for adding AWSMobileClient to your project as a credentials manager
import UIKit
import AWSMobileClient //#1
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
@mobilequickie
mobilequickie / Podfile
Created October 11, 2018 16:26
Podfile for basic auth via Cognito User Pools and Facebook Login for the AWS Mobile SDK for iOS
# Uncomment the next line to define a global platform for your project
# platform :ios, '11.0'
target '<YOURPOJECTNAMEHERE>' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BasicandFBAuth
pod 'AWSMobileClient'
pod 'AWSFacebookSignIn'
@mobilequickie
mobilequickie / Podfile-google
Last active October 16, 2018 00:42
Podfile for basic auth via Cognito User Pools and Google Sign-In for the AWS Mobile SDK for iOS
# Uncomment the next line to define a global platform for your project
# platform :ios, '11.0'
target 'GoogleAuth' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BasicandGoogleSignIn
pod 'AWSMobileClient'
@mobilequickie
mobilequickie / Plist-Google.xml
Created October 16, 2018 01:12
This is the Google Sign-In custom URL scheme for iOS in the Info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.###########-xxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
</array>
</dict>
</array>
@mobilequickie
mobilequickie / LWAViewController.swift
Last active April 26, 2019 06:07
Login with Amazon - View controller for handling login/logout for LWA
//
// ViewController.swift
// AuthLWA
//
// Created by Hills, Dennis on 4/26/19.
// Copyright © 2019 Hills, Dennis. All rights reserved.
//
// Requires LoginWithAmazonProxy.swift from here: https://gist.github.com/mobilequickie/56916503a41ebb2374fea241ede26eab
// Gist: https://gist.github.com/mobilequickie/346caccc2a07f18e2bea4fdf6fe8fd3f
//
@mobilequickie
mobilequickie / LoginWithAmazonProxy.swift
Last active April 26, 2019 05:50
Login with Amazon proxy for iOS Swift app
// LoginWithAmazonProxy.swift
//
// Created by Hills, Dennis on 4/26/19.
// Copyright © 2019 Hills, Dennis. All rights reserved.
//
// Original credit to SUPERDASHENG at https://superdasheng.wordpress.com/author/superdasheng/
// Added logout, getAccessToken, and getUserProfile
// https://gist.github.com/mobilequickie/56916503a41ebb2374fea241ede26eab
import Foundation
@mobilequickie
mobilequickie / AppDelegateLWASnippet.swift
Created November 1, 2018 23:05
The open url function for AppDelegate to handle callback from Login with Amazon flow
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
return AIMobileLib.handleOpen(url, sourceApplication: UIApplication.OpenURLOptionsKey.sourceApplication.rawValue)
}