Skip to content

Commit

Permalink
[Refactoring] Updated README about building the individual parts.
Browse files Browse the repository at this point in the history
  • Loading branch information
joerghartmann committed Aug 7, 2023
1 parent 67df230 commit b2b7bde
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
BUILD_OFFSET: 100

jobs:
build:
build-ios:
runs-on: macos-12
steps:
- name: Checkout
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ The Cumulocity IoT Alarm App is available for Android and iOS. Open the app on y

<img src="./ios/screenshots/dashboard.png" width="180" /> <img src="./ios/screenshots/alarm_list.png" width="180" /> <img src="./ios/screenshots/alarm_details.png" width="180" /> <img src="./ios/screenshots/device_details.png" width="180" />

> Enabling push notifications requires dedicated microservices to be deployed on your Cumulocity IoT tenant.
Enabling push notifications requires dedicated microservices to be deployed on your Cumulocity IoT tenant.

## FAQ
## Getting Started

The latest release can be found [here](https://github.com/SoftwareAG/cumulocity-alarmapp/releases/latest).

###### What does it contain?

The release contains binaries for Android and iOS:

- An unsigned `APK` file, which can be distributed to devices,
- An unsigned `IPA` file, which can be distributed, but must be signed before deployed to devices.

It does not contain microservices because certain properties need to be configured before you build them.

###### How to build the individual parts?

- [How to build for iOS?](./ios/README.md)
- [How to build for Android?](./android/README.md)
Expand Down
6 changes: 3 additions & 3 deletions ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The following tools are required to build the app:

## Build

`Build` github worlflow creates an unsigned ipa as well as an Xcode Archive. The ipa file may be uploaded to the App Store or deployed to devices using a Mobile-Device-Management (MDM) solution.
The `build-ios` GitHub workflow creates an unsigned `IPA` as well as an Xcode Archive. The `IPA` file can be uploaded to the App Store or deployed to devices using a Mobile-Device-Management (MDM) solution.

The latest release can be found [here](https://github.com/SoftwareAG/cumulocity-alarmapp/releases/latest).

> **This build can be distributed, but must be signed before deployed to devices.**
**This build can be distributed, but must be signed before deployed to devices.**

## Code Sign

Expand All @@ -30,7 +30,7 @@ In order to re-sign the application, you'll need to prepare your developer accou

### Using Fastlane

To sign the ipa, it is recommended to use [Fastlane](https://fastlane.tools). See documentation for [Fastlane resign](https://docs.fastlane.tools/actions/resign/) for more infos and config options, for example to change version number, display name, etc. when resigning.
To sign the `IPA`, it is recommended to use [Fastlane](https://fastlane.tools). See documentation for [Fastlane resign](https://docs.fastlane.tools/actions/resign/) for more infos and config options, for example to change version number, display name, etc. when resigning.

```bash
> fastlane run resign ipa:./AlarmApp.ipa signing_identity:"<Keychain Identity of certificate>" provisioning_profile:<path provisioning profile>
Expand Down
29 changes: 24 additions & 5 deletions microservices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ The repository contains an example microservice (see [message-emitter](./c8y-pus

An OpenAPI specification of all RESTful services provided by the Push Gateway can be found [here](./c8y-push-api/openapi.yml).

## Build

Building the Push Gateway requires a Notification Hub to be existing first. Copy the `Manage,Listen,Send` permission as well as the `name` of the Hub to the `application-prod.properties` file located within the [push-bundle](./c8y-push-gateway/push-bundle) module.

```
defaultsettings.hub=<Name of your Notification Hub>
defaultsettings.connection=<Value of the Managed,Listen,Send permission>
```

Afterwards execute the Maven goal `install` on the root directory at `./c8y-push-gateway`.

```
mvn clean install
```

Now, build the [message-emitter](./c8y-push-message-emitter) by calling the `install` goal.

> Make sure the following tools [Docker](https://www.docker.com/) and [Maven](https://maven.apache.org/) are installed on your machine.
## Workflow

### Obtaining device tokens
Expand Down Expand Up @@ -88,11 +107,11 @@ Use the following service to trigger push notifications. Each request will be fo
```json
{
"receiver": [
"deviceTokens": [
"string"
],
"userIds": [
"Cumulocity IoT user id"
],
"deviceTokens": [
"string"
]
],
"tags": [
Expand All @@ -106,8 +125,8 @@ Use the following service to trigger push notifications. Each request will be fo
}
}
```

If `userIds` and `deviceTokens` are empty, a notification is sent to each registered user. `tags` can be used to filter push notifications. If specified, receivers registrations do need to specify the same tags.
A push notification is sent to each registrations as long as `deviceTokens` or `userIds` are not set explicitly. The use of `deviceTokens` takes precedence over `userIds`. `tags` can be used to filter push notifications. If specified, receivers registrations do need to specify the same tags.

`message` is a required property and must contain one `alarmId`. The Push Gateway will load the Alarm by it's id and hand it over as payload of the push notification.

Expand Down

0 comments on commit b2b7bde

Please sign in to comment.