chore: add licenses to ios and android SDK (#4893)

This commit is contained in:
Matti Nannt
2025-03-07 18:18:31 +01:00
committed by GitHub
parent 6075fd3ef8
commit 432425ea59
9 changed files with 2951 additions and 70 deletions

View File

@@ -3,7 +3,7 @@ Copyright (c) 2024 Formbricks GmbH
Portions of this software are licensed as follows:
- All content that resides under the "apps/web/modules/ee" directory of this repository, if these directories exist, is licensed under the license defined in "apps/web/modules/ee/LICENSE".
- All content that resides under the "packages/js/", "packages/react-native/" and "packages/api/" directories of this repository, if that directories exist, is licensed under the "MIT" license as defined in the "LICENSE" files of these packages.
- All content that resides under the "packages/js/", "packages/react-native/", "packages/android/", "packages/ios/" and "packages/api/" directories of this repository, if that directories exist, is licensed under the "MIT" license as defined in the "LICENSE" files of these packages.
- All third party components incorporated into the Formbricks Software are licensed under the original license provided by the owner of the applicable component.
- Content outside of the above mentioned directories or restrictions above is available under the "AGPLv3" license as defined below.

9
packages/android/LICENSE Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) 2025 Formbricks GmbH
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:
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.

View File

@@ -0,0 +1,53 @@
# Setup
To run the project, open the `android` folder in **Android Studio**. The project contains two modules:
- **app**: A demo application to exercise the SDK.
- **formbricksSDK**: The SDK package.
Before launching the app, update the mandatory variables in `MainActivity`:
```kotlin
val config = FormbricksConfig.Builder("[API_HOST]", "[ENVIRONMENT_ID]")
.setLoggingEnabled(true)
.setFragmentManager(supportFragmentManager)
```
Once these values are properly set, the demo app can be launched.
The app consists of a single view, `FormbricksDemo`. It is a very simple Jetpack Compose view with a single button.
The button's action should be updated according to the survey actions:
```kotlin
Formbricks.track("click_demo_button")
```
Replace `"click_demo_button"` with the desired action.
---
# Documentation
You can generate developer documentation for the SDK using **Dokka**.
To do this, navigate to the `android` folder in a `Terminal` window (or open it in Android Studio) and run:
```sh
./gradlew dokkaHtml
```
This will generate the developer documentation in the `formbricksSDK/build/dokka/html` folder.
---
## Unit Tests
The SDK includes a unit test to verify the Manager's functionality. To run it:
1. Open the `FormbricksInstrumentedTest` file.
2. Since the SDK requires a `Context` for initialization, it uses an instrumented test.
3. Click the double arrow next to `class FormbricksInstrumentedTest` to execute the tests.
To generate a coverage report, navigate to the `android` folder in a `Terminal` window (or open it in Android Studio) and run:
```sh
./gradlew createDebugCoverageReport
```

View File

@@ -1,38 +0,0 @@
# Setup
To run the project you just have to open the `android` folder in **Android Studio**. The project will contain 2 modules:
- **app**: a demo application to excercise the SDK
- **formbricksSDK**: the SDK package
Before you launch the app, please make sure to update the mandatory variables in the `MainActivity`:
```
val config = FormbricksConfig.Builder("[API_HOST]","[ENVIRONMENT_ID]")
.setLoggingEnabled(true)
.setFragmentManager(supportFragmentManager)
```
Once they are set to the proper values, the Demo app can be launched.
The app has a single view, the `FormbricksDemo`. It it a very simple Jetpack Compose view with a single button.
The button's action should be updated according to the survey actions:
```
Formbricks.track("click_demo_button")
```
Change `click_demo_button` to the desired action.
# Docs
You can generate developer documentation for the SDK with pressing with `Dokka`.
For this, navigate to the `android` folder in a `Terminal` window (or open it in Android Studio), and type
```
./gradlew dokkaHtml
```
and press enter. This will generate the developer documentation to `formbricksSDK/build/dokka/html` folder.
## Unit test
The SDK has a unit test to verify the Manager's functionality. To run it, open the `FormbricksInstrumentedTest` file. We need a `Context` to initialize the SDK, thus, we use instrumented test. Click the double arrow next to the `class FormbricksInstrumentedTest` to execute the tests.
To generate coverage report, navigate to the `android` folder in a `Terminal` window (or open it in Android Studio), and type
```
./gradlew createDebugCoverageReport
```

View File

@@ -64,7 +64,7 @@ import Network
Example:
```swift
Formbricks.setUserId(with: "USER_ID_HERE")
Formbricks.setUserId("USER_ID_HERE")
```
*/
@objc public static func setUserId(_ userId: String) {

9
packages/ios/LICENSE Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) 2025 Formbricks GmbH
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:
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.

41
packages/ios/README.md Normal file
View File

@@ -0,0 +1,41 @@
# Setup
To run the project, open `Formbricks.xcworkspace` in **Xcode**. The workspace contains two projects:
- **FormbricksSDK**: The SDK package.
- **Demo**: A demo application to exercise the SDK.
Before launching the `Demo` app, update the mandatory variables in `AppDelegate`:
```swift
let config = FormbricksConfig.Builder(appUrl: "[APP_URL]", environmentId: "[ENVIRONMENT_ID]")
.setLogLevel(.debug)
.build()
```
Once these values are properly set, the demo app can be launched.
The demo app consists of a single view, `ContentView`. It is a SwiftUI view with a single button.
The button's action should be updated according to the survey actions:
```swift
Formbricks.track("click_demo_button")
```
Replace `"click_demo_button"` with the desired action.
---
# Swift Documentation
You can generate developer documentation for the SDK by pressing **Shift + Command + Option + D** on macOS or by selecting **Product → Build Documentation** in Xcode.
---
## Unit Tests
The SDK includes a unit test to verify the Manager's functionality. To run it:
1. Select the `Test Navigator` tab in Xcode.
2. Run the `testFormbricks()` method.
The coverage report can be found in the `Report Navigator` tab.

View File

@@ -1,30 +0,0 @@
# Setup
To run the project you just have to open the `Formbricks.xcworkspace` in Xcode. The workspace will contain 2 projects:
- **FormbricksSDK**: the SDK package
- **Demo**: a demo application to excercise the SDK
Before you launch the `Demo` app, please make sure to update the mandatory variables in the `AppDelegate`:
```
let config = FormbricksConfig.Builder(appUrl: "[appUrl]", environmentId: "[environmentId]")
.setLogLevel(.debug)
.build()
```
Once they are set to the proper values, the Demo app can be launched.
The Demo app has a single view, the `ContentView`. It is a SwiftUI view with a single Button.
The button's action should be updated according to the survey actions:
```
Formbricks.track("click_demo_button")
```
Change `click_demo_button` to the desired action.
# Swift Docs
You can generate developer documentation for the SDK with pressing `CTRL + Shift + Command + O` in OSX, or generate it by clicking `Product -> Build Documentation` in Xcode.
## Unit test
The SDK has a unit test to verify the Manager's functionality. To run it, select the `Test navigator` tab in Xcode and run the `testFormbricks()` method. The coverage can be found in the `Report navigator` tab.

File diff suppressed because it is too large Load Diff