Skip to content

Commit

Permalink
Merge master into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mstanic-shake committed Sep 11, 2023
2 parents 905fab5 + a1600b3 commit b9a48ea
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 45 deletions.
71 changes: 51 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,60 @@
# README #
# Shake SDK Demo App

This README would normally document whatever steps are necessary to get your application up and running.
iOS app you can use to try out [Shake](https://www.shakebugs.com/) and its features.

### What is this repository for? ###
## Use

* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
This repository contains the source code for the Shake Demo App.

### How do I get set up? ###
### License

* Summary of set up
* Configuration
* Dependencies
* Database configuration
* How to run tests
* Deployment instructions
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/shakebugs/shake-demo-ios/blob/master/LICENSE.md)

### Contribution guidelines ###
```
* Writing tests
* Code review
* Other guidelines
Copyright (c) 2021 Shake and Sanjin Grahovar Sadiković
### Who do I talk to? ###
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
* Repo owner or admin
* Other community or team contact
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```

## Description

This app is intended as a playground for what Shake can do, without having to add it to a specific project.

### Features

- Bug reporting - submit a bug you can check out on the [Demo Dashboard](https://app.shakebugs.com/signin?user=demo).
- Crash reporting - simulate a crash you can check out on the [Demo Dashboard](https://app.shakebugs.com/signin?user=demo).
- Customize - change how the SDK is invoked, its form fields and data that's attached.

### Screens

<img src="https://i.ibb.co/k1Kz9yd/Untitled-design-22.png">

## How to run

1. Clone the GitHub repository and open the project.
2. Run ```pod install``` to install the necessary dependencies.
3. Build the app & enjoy.

## Authors

- Sanjin Grahovar Sadikovic - [sgrahovar-shake](https://github.com/orgs/shakebugs/people/sgrahovar-shake)
Binary file not shown.
50 changes: 25 additions & 25 deletions shake-demo-ios/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,53 @@ import Shake
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let defaults = UserDefaults.standard

// Shaking invocation
if defaults.object(forKey: "isInvokedByShakeDeviceEvent") == nil{
defaults.set(true, forKey: "isInvokedByShakeDeviceEvent")
}
Shake.configuration.isInvokedByShakeDeviceEvent = defaults.bool(forKey: "isInvokedByShakeDeviceEvent")

// Floating button invocation
if defaults.object(forKey: "isFloatingReportButtonShown") == nil{
defaults.set(false, forKey: "isFloatingReportButtonShown")
}
Shake.configuration.isFloatingReportButtonShown = defaults.bool(forKey: "isFloatingReportButtonShown")


// Screenshot invocation method
if defaults.object(forKey: "isInvokedByScreenshot") == nil{
defaults.set(false, forKey: "isInvokedByScreenshot")
}
Shake.configuration.isInvokedByScreenshot = defaults.bool(forKey: "isInvokedByScreenshot")


// Console logs enabled/disabled
if defaults.object(forKey: "isConsoleLogsEnabled") == nil{
defaults.set(false, forKey: "isConsoleLogsEnabled")
}
Shake.configuration.isConsoleLogsEnabled = defaults.bool(forKey: "isConsoleLogsEnabled")

// Blackbox enabled/disabled
if defaults.object(forKey: "isBlackBoxEnabled") == nil{
defaults.set(false, forKey: "isBlackBoxEnabled")
}
Shake.configuration.isBlackBoxEnabled = defaults.bool(forKey: "isBlackBoxEnabled")


// Included screenshot enabled/disabled
if defaults.object(forKey: "isScreenshotIncluded") == nil{
defaults.set(true, forKey: "isScreenshotIncluded")
}
Shake.configuration.isScreenshotIncluded = defaults.bool(forKey: "isScreenshotIncluded")


// Email field enabled/disabled
if defaults.object(forKey: "isEmailFieldEnabled") == nil{
defaults.set(false, forKey: "isEmailFieldEnabled")
Expand All @@ -68,32 +68,32 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
if defaults.object(forKey: "isInspectScreenEnabled") == nil{
defaults.set(false, forKey: "isInspectScreenEnabled")
}

// Feedback type enabled/disabled
if defaults.object(forKey: "isFeedbackTypeEnabled") == nil{
defaults.set(false, forKey: "isFeedbackTypeEnabled")
}

// Feedback type enabled/disabled
if defaults.object(forKey: "shakingThreshold") == nil{
defaults.set(600, forKey: "shakingThreshold")
}
Shake.configuration.shakingThreshold = defaults.float(forKey: "shakingThreshold")

Shake.configuration.isCrashReportingEnabled = true
Shake.configuration.isAskForCrashDescriptionEnabled = true
Shake.configuration.setShowIntroMessage = true
Shake.configuration.isInvokedByRightEdgePan = false
Shake.configuration.isAutoVideoRecordingEnabled = false

Shake.start(clientId: "lEtd511X2gn3qsgR1RWPVEL15RpKbdY0r6x99LFP", clientSecret: "nErTSH6tgNB1dMDAQKQaMNA1d8yD8tEDl82XPrYQEucvG9vFy89JqWZ")

ShakeUtils.buildShakeForm()

Shake.registerUser(userId: UIDevice.current.identifierForVendor!.uuidString)

var userMetadata = [String: String]()

userMetadata = [
"first_name": "John",
"last_name": "Doe",
Expand All @@ -102,21 +102,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
"cartItems": "3",
"cartTotal": "$25.33"
]

Shake.updateUserMetadata(userMetadata)

return true
}

// MARK: UISceneSession Lifecycle

@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
Expand Down

0 comments on commit b9a48ea

Please sign in to comment.