-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add docs on how to add sample apps to code base (#280)
- Loading branch information
1 parent
f9146ee
commit 303ef55
Showing
17 changed files
with
603 additions
and
31 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
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
Apps/APN-UIKit/APN UIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Apps/APN-UIKit/APN UIKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.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,8 @@ | ||
<?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>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</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,5 @@ | ||
<?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/> | ||
</plist> |
11 changes: 11 additions & 0 deletions
11
Apps/APN-UIKit/APN UIKit/Assets.xcassets/AccentColor.colorset/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,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
Apps/APN-UIKit/APN UIKit/Assets.xcassets/AppIcon.appiconset/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,63 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "16x16" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "16x16" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "32x32" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "32x32" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "128x128" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "128x128" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "256x256" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "256x256" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "512x512" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "512x512" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Apps/APN-UIKit/APN UIKit/Preview Content/Preview 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 | ||
} | ||
} |
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,12 @@ | ||
import CioTracking | ||
import Foundation | ||
import UIKit | ||
|
||
@main | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
CustomerIO.initialize(siteId: "", apiKey: "", region: .US, configure: nil) | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
app_identifier(["io.customer.ios-sample.cocoapods-fcm", "io.customer.ios-sample.cocoapods-fcm.richpush"]) | ||
team_id "2YC97BQN3N" | ||
# Include all of the bundle identifiers for your iOS app and for your rich push target. | ||
# You find the bundle identifier of each app inside of Xcode - https://stackoverflow.com/a/59131511 | ||
app_identifier(["io.customer.ios-sample.cocoapods-fcm", "io.customer.ios-sample.cocoapods-fcm.richpush"]) |
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 |
---|---|---|
@@ -1,22 +1 @@ | ||
platform :ios do | ||
|
||
before_all do |lane, options| | ||
setup_ci | ||
end | ||
|
||
# Note: I was experiencing issues getting adhoc code signing working for the cocoapods FCM sample app. | ||
# For now, we just need to test the app compiles so development code signing is good enough for now until we fix the issue. | ||
# For now, do code signing and app compiling using development type. | ||
lane :build_app do |arguments| | ||
sync_code_signing( | ||
type: "development" | ||
) | ||
|
||
build_ios_app( | ||
export_method: "development", | ||
configuration: "Debug", | ||
xcodebuild_formatter: "xcbeautify" | ||
) | ||
end | ||
|
||
end | ||
import "../../fastlane/Fastfile" # imports shared Fastfile from "Apps/fastlane/Fastfile" |
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# Scheme of your app inside of Xcode. | ||
# Make sure the scheme is Shared - https://stackoverflow.com/a/8425495 | ||
# https://developer.apple.com/documentation/xcode/customizing-the-build-schemes-for-a-project/ | ||
scheme "test cocoapods" | ||
# If your iOS app uses CocoaPods, you will want to specify the path to the xcworkspace for the app. | ||
workspace "test cocoapods.xcworkspace" | ||
export_method 'ad-hoc' | ||
# If your project uses Swift Package Manager instead of CocoaPods, use: | ||
# project "test cocoapods.xcodeproj" |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Sample apps | ||
|
||
# Create a new sample app | ||
|
||
* In Xcode, create a new iOS app. Put the iOS app in a new directory inside of `Apps/` directory of this repository. There are examples in this repository that you can reference. | ||
|
||
* [Setup code signing for this new iOS app](https://github.com/customerio/apple-code-signing#creating-a-new-ios-app). | ||
|
||
* Copy the directory: `Apps/CocoaPods-FCM/fastlane/` into your new iOS sample app's directory. These files are required in order for the CI server to compile the sample app. Go through each of the files and edit them to values that are correct for your new iOS app. | ||
|
||
* Time to install the Customer.io SDK into the Xcode project. All sample apps are meant to install the *local copy on the file system* of the SDK instead of a version of the SDK in production. | ||
|
||
Note: It's preferred to use Swift Package Manager instead of CocoaPods but some sample apps need to use CocoaPods so we can test that environment customers may have. | ||
|
||
**If your new sample app uses CocoaPods**, then copy the `Podfile` from `../Apps/CocoaPods-FCM/Podfile`. That file is designed to always install the SDK from the local copy of the SDK which is what all of our sample apps should be doing. | ||
|
||
**If your new sample app uses Swift Package Manager**, you need to [follow these steps](https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package#Overview). By following those steps, you will (1) install the CIO SDK inside of Xcode as you normally would. Installing a production version of the SDK. Then, you will drag+drop the CIO SDK directory on your computer into Xcode which then *overrides* the production version of the SDK. This means that Xcode will now compile the iOS app using the *local* copy of the SDK instead of production copy. After you are done, this is what Xcode should look like: | ||
|
||
![customer.io ios sdk source code directory should be added to project explorer](../docs/img/xcode_view_spm_localsdk.png) | ||
|
||
* Open `../.github/workflows/build-sample-apps.yml`. In this file, you will see code that looks like this: | ||
|
||
```yml | ||
... | ||
matrix: # Use a matrix allowing us to build multiple apps in parallel. Just add an entry to the matrix and it will build! | ||
sample-app: | ||
- "Foo" | ||
``` | ||
|
||
Add a new entry to this list. The value will be the new directory that you created inside of `Apps/`. For example, if the new iOS app you made is inside of: `Apps/CocoaPods-FCM/`, then add this entry to this file: | ||
|
||
```yml | ||
... | ||
matrix: # Use a matrix allowing us to build multiple apps in parallel. Just add an entry to the matrix and it will build! | ||
sample-app: | ||
- "CocoaPods-FCM" | ||
``` | ||
|
||
When you make a pull request for the new sample app that you created, you should see this app get compiled by the CI server. | ||
|
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,38 @@ | ||
# Fastfile that is meant to be used by all iOS apps in the organization. | ||
# This file is meant to be imported into another `Fastfile` so the functions in this file are usable. | ||
# | ||
# Import this file in 2 ways: | ||
# 1. Locally (for all Fastfile files in this repository) | ||
# Use "import" from these docs: https://docs.fastlane.tools/advanced/Fastfile/#importing-another-fastfile | ||
# | ||
# 2. Remotely (for all Fastfile files in a git repository not this one) | ||
# Add this to your Fastfile: | ||
# ``` | ||
# import_from_git( | ||
# url: "git@github.com:customerio/customerio-ios.git", # The URL of the repository to import the Fastfile from. | ||
# branch: "main", # The branch to checkout on the repository. | ||
# path: "Apps/fastlane/Fastfile" # The path of the Fastfile in the repository. | ||
# ) | ||
# ``` | ||
|
||
before_all do |lane, options| | ||
setup_ci | ||
end | ||
|
||
# Note: I was experiencing issues getting adhoc code signing working for the cocoapods FCM sample app. | ||
# For now, we just need to test the app compiles so development code signing is good enough for now until we fix the issue. | ||
# For now, do code signing and app compiling using development type. | ||
lane :build do |arguments| | ||
sync_code_signing( | ||
type: "development", | ||
readonly: true, | ||
storage_mode: "google_cloud", | ||
google_cloud_bucket_name: "remote-habits-ios-signing" | ||
) | ||
|
||
build_ios_app( | ||
export_method: "development", | ||
configuration: "Debug", | ||
xcodebuild_formatter: "xcbeautify" | ||
) | ||
end |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.