Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #24 #28

Merged
merged 2 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ List {

```

You can also hide the dismiss button to have a persistent banner, by adding `hideDismissButtonAndTimer: true` to your `BillboardBannerView`.

![BillboardBannerExamples](https://github.com/hiddevdploeg/Billboard/assets/5016984/259603dd-3160-4552-a3da-990ecb33afd4)

## Configuration
Expand Down Expand Up @@ -201,6 +203,7 @@ Feel free to use the [Billboard template for Figma](https://www.figma.com/commun
- Avoid using your App Icon as the image (as it's already displayed by default).
- Provide an image with no background or has a single color (avoid gradients).
- Photos are allowed as well but will be displayed differently.
- Try and submit an evergreen image that represents your app, show it's good practice to avoid showing UI that gets outdated fast.

## Ad Types
The media of an ad will be displayed covering the whole view when `BillboardAd.fullscreen` is set to `true`. This works great if the media is a photo instead of a visual. Please consider that the photo's subject must be in the center, which will ensure it's always visible.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Billboard/Models/BillboardAd.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public struct BillboardAd : Codable, Identifiable, Equatable {
public let media : URL

/// App Store Link based on `appStoreID`
public var appStoreLink : URL {
return URL(string: "https://apps.apple.com/app/id\(appStoreID)")!
public var appStoreLink : URL? {
return URL(string: "https://apps.apple.com/app/id\(appStoreID)")
}

/// Main Background color in HEX format
Expand Down
4 changes: 3 additions & 1 deletion Sources/Billboard/Views/BillboardBannerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public struct BillboardBannerView : View {

HStack(spacing: 10) {
Button {
openURL(advert.appStoreLink)
if let url = advert.appStoreLink {
openURL(url)
}
canDismiss = true
} label: {
HStack(spacing: 10) {
Expand Down