Skip to content

Commit

Permalink
Version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lowip committed May 13, 2022
1 parent c4856ea commit 96dccf1
Show file tree
Hide file tree
Showing 180 changed files with 10,741 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: 🐞 Bug report
description: File a Bug Report for unexpected or incorrect SDK Behavior
title: '[Bug]: '
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please consider contacting support@braze.com for faster integration troubleshooting and to avoid leaking private information to our public Github issues.
- type: dropdown
id: platform
attributes:
label: Platform
multiple: false
options:
- iOS
- Mac Catalyst
- Other
validations:
required: true
- type: input
id: platform_version
attributes:
label: Platform Version
placeholder: ex. iOS 15.4
validations:
required: true
- type: input
id: sdk_version
attributes:
label: Braze SDK Version
placeholder: ex. 5.0.0
validations:
required: true
- type: input
id: xcode_version
attributes:
label: Xcode Version
placeholder: ex. Xcode 13.3
validations:
required: true
- type: dropdown
id: processor
attributes:
label: Computer Processor
multiple: false
options:
- Intel
- Apple (M1)
validations:
required: true
- type: input
id: repro_rate
attributes:
label: Repro Rate
description: How often can you reproduce this bug?
placeholder: ex. 100% of the time
validations:
required: true
- type: textarea
id: repro_steps
attributes:
label: Steps To Reproduce
description: Please provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)
value: |
Example:
1. Add `braze.logCustomEvent(name: "custom_event")` in `AppDelegate.swift`.
2. Run the app.
validations:
required: true
- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: What was supposed to happen?
validations:
required: true
- type: textarea
id: actual_behavior
attributes:
label: Actual Incorrect Behavior
description: What incorrect behavior happened instead?
validations:
required: true
- type: textarea
id: verbose_logs
attributes:
label: Verbose Logs
description: Please copy and paste verbose log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: other_info
attributes:
label: Additional Information
description: Anything else you'd like to share?
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Braze Support
url: https://support.braze.com/
about: Contact Braze Support for company or campaign-specific troubleshooting
- name: Security Issues
url: https://www.braze.com/docs/developer_guide/disclosures/security_and_vulnerability_disclosure/
about: Please report security vulnerabilities here.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ✅ Feature Request
description: Request New SDK Features
title: '[Feature]: '
labels: ["feature-request"]
body:
- type: markdown
attributes:
value: |
Did you know: You can also submit feature requests in our [Public Roadmap Portal](https://dashboard.braze.com/resources/roadmap)
- type: textarea
id: problem
attributes:
label: What problem are you facing?
description: Help us understand what you're unable to accomplish, or what's difficult with your integration
placeholder: |
ex: I am unable to accomplish XYZ today, since the SDK does not allow me to...
validations:
required: true
- type: textarea
id: workarounds
attributes:
label: Workarounds
description: Are there any workarounds you can use? How complicated are they?
validations:
required: true
- type: textarea
id: ideal_solution
attributes:
label: Ideal Solution
description: What would your ideal solution look like?
validations:
required: false
- type: textarea
id: other_information
attributes:
label: Other Information
description: Any additional information you'd like to share?
validations:
required: false
Binary file added .github/assets/logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
Examples/Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 5.0.0 (Early Access)

We are excited to announce the initial release of the Braze Swift SDK!

The Braze Swift SDK is set to replace the [current Braze iOS SDK](https://github.com/Appboy/appboy-ios-sdk/) and provides a more modern API, simpler integration, and better performance.

### Current limitations

The following features are not supported yet:
- Objective-C integration
- tvOS integration
- News Feed
- Content Cards
25 changes: 25 additions & 0 deletions Examples/Analytics/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import UIKit
import BrazeKit

// MARK: - Configure Braze

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

static var braze: Braze? = nil

func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// Setup Braze
var configuration = Braze.Configuration(apiKey: brazeApiKey, endpoint: brazeEndpoint)
configuration.logger.level = .info
let braze = Braze(configuration: configuration)
AppDelegate.braze = braze

window?.makeKeyAndVisible()
return true
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions Examples/Analytics/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
20 changes: 20 additions & 0 deletions Examples/Analytics/AuthenticationManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Foundation
import BrazeKit

class AuthenticationManager {

struct User {
let id: String
let email: String
let birthday: Date
}

func userDidLogin(_ user: User) {
AppDelegate.braze?.changeUser(userId: user.id)
let brazeUser = AppDelegate.braze?.user
brazeUser?.set(email: user.email)
brazeUser?.set(dateOfBirth: user.birthday)
brazeUser?.setCustomAttribute(key: "last_login_date", value: Date())
}

}
25 changes: 25 additions & 0 deletions Examples/Analytics/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
36 changes: 36 additions & 0 deletions Examples/Analytics/CheckoutViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import UIKit

class CheckoutViewController: UIViewController {

/// The internal checkout identifier
var checkoutId: String = ""

/// The list of identifiers for the products to checkout
var productIds: [String] = []

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
AppDelegate.braze?.logCustomEvent(
name: "open_checkout_controller",
properties: [
"checkout_id": checkoutId,
"product_ids": productIds,
]
)
}

func userDidPurchase(productId: String) {
let price = self.price(productId: productId)
AppDelegate.braze?.logPurchase(
productId: productId,
currency: "USD",
price: price,
properties: ["checkout_id": checkoutId]
)
}

private func price(productId: String) -> Double {
[0.5, 8.0, 14.99, 0, 999.999].randomElement()!
}

}
Loading

0 comments on commit 96dccf1

Please sign in to comment.