diff --git a/README.md b/README.md index 0bde405..388cd32 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/Sources/Billboard/Models/BillboardAd.swift b/Sources/Billboard/Models/BillboardAd.swift index 3e11a93..74dd1e7 100644 --- a/Sources/Billboard/Models/BillboardAd.swift +++ b/Sources/Billboard/Models/BillboardAd.swift @@ -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 diff --git a/Sources/Billboard/Views/BillboardBannerView.swift b/Sources/Billboard/Views/BillboardBannerView.swift index 2f76675..5609279 100644 --- a/Sources/Billboard/Views/BillboardBannerView.swift +++ b/Sources/Billboard/Views/BillboardBannerView.swift @@ -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) {