-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
611 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.developer.parent-application-identifiers</key> | ||
<array> | ||
<string>$(AppIdentifierPrefix)pt.tig.awsary</string> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// AWSaryAppClipApp.swift | ||
// AWSaryAppClip | ||
// | ||
// Created by Tiago Rodrigues on 09/03/2024. | ||
// | ||
|
||
import SwiftUI | ||
import RevenueCat | ||
|
||
@main | ||
struct AWSaryAppClipApp: App { | ||
|
||
init(){ | ||
/* Enable debug logs before calling `configure`. */ | ||
Purchases.logLevel = .debug | ||
/* Initialize the RevenueCat Purchases SDK. */ | ||
Purchases.configure( | ||
with: Configuration.Builder(withAPIKey: Constants.apiKey) | ||
.build() | ||
) | ||
/* Set the delegate to our shared instance of PurchasesDelegateHandler */ | ||
Purchases.shared.delegate = PurchasesDelegateHandler.shared | ||
} | ||
|
||
|
||
var body: some Scene { | ||
WindowGroup { | ||
ContentView() | ||
.task { | ||
do { | ||
// Fetch the available offerings | ||
UserViewModel.shared.offerings = try await Purchases.shared.offerings() | ||
} catch { | ||
print("Error fetching offerings: \(error)") | ||
} | ||
} | ||
.accentColor(Color(red:1.0, green: 0.5, blue: 0.0)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
// | ||
// SettingsView.swift | ||
// awsary | ||
// | ||
// Created by Tiago Rodrigues on 20/07/2022. | ||
// | ||
|
||
import SwiftUI | ||
import StoreKit | ||
import RevenueCat | ||
|
||
struct AboutView: View { | ||
@Environment(\.dismiss) var dismiss | ||
@ObservedObject var userModel = UserViewModel.shared | ||
@ObservedObject var awsServices = AwsServices() | ||
@AppStorage("awsServiceLogoWithLabel") var awsServiceLogoWithLabel: Bool = false | ||
|
||
var body: some View { | ||
let randomAWSservice = awsServices.getRandomElement() | ||
|
||
NavigationStack{ | ||
List{ | ||
Section(header: Text("Configure service logos")){ | ||
VStack{ | ||
Toggle(isOn: $awsServiceLogoWithLabel){ | ||
Text("Show name on service logo") | ||
} | ||
// .disabled(!self.userModel.subscriptionActive) | ||
// Text("") | ||
// Text("Drag-and-drop each of the icons bellow, to test it on your diagrams.\n\nTap to load a diferent random icon, purchange a subscription to enable on all logos.") | ||
LazyVGrid( | ||
columns: [GridItem(.adaptive(minimum: 110))], content: { | ||
|
||
if (awsServiceLogoWithLabel){ | ||
AWSserviceImagePlaceHolderView(service: randomAWSservice, showLabel: false) | ||
AWSserviceImagePlaceHolderView(service: randomAWSservice, showLabel: true) | ||
.padding(.horizontal, 8) | ||
.padding(.vertical, 6) | ||
.background(Color(red:1.0, green: 0.5, blue: 0.0)) | ||
.cornerRadius(8.0) | ||
}else{ | ||
AWSserviceImagePlaceHolderView(service: randomAWSservice, showLabel: false) | ||
.padding(.horizontal, 8) | ||
.padding(.vertical, 6) | ||
.background(Color(red:1.0, green: 0.5, blue: 0.0)) | ||
.cornerRadius(8.0) | ||
AWSserviceImagePlaceHolderView(service: randomAWSservice, showLabel: true) | ||
} | ||
} | ||
).frame(minHeight: 160) | ||
} | ||
} | ||
Section(header: Text("Feedback")){ | ||
// Label("Send Feedback", systemImage: "envelope") | ||
Label { | ||
VStack(alignment: .leading){ | ||
Text("Rate version \(Bundle.main.appVersionLong) of AWSary") | ||
Text("Be like the 19 other beautiful people that have rated this version.").font(.footnote).opacity(0.6) | ||
} | ||
} icon:{ | ||
Image(systemName: "star.fill") | ||
}.onTapGesture { | ||
let appId = "1634871091" | ||
let url_string = "itms-apps://itunes.apple.com/app/id\(appId)?mt=8&action=write-review" | ||
guard let url = URL(string: url_string) else { | ||
return | ||
} | ||
UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
} | ||
|
||
Label { | ||
VStack(alignment: .leading){ | ||
Text("Send Feedback") | ||
Text("Feedback emails are lovely to read!").font(.footnote).opacity(0.6) | ||
} | ||
} icon:{ | ||
Image(systemName: "envelope") | ||
}.onTapGesture { | ||
let address = "[email protected]" | ||
let subject = "Feedback on AWSary" | ||
|
||
// Example email body with useful info for bug reports | ||
let body = "\n\n--\nAWSary Version: \(Bundle.main.appVersionLong) (\(Bundle.main.appBuild))" | ||
|
||
// Build the URL from its components | ||
var components = URLComponents() | ||
components.scheme = "mailto" | ||
components.path = address | ||
components.queryItems = [ | ||
URLQueryItem(name: "subject", value: subject), | ||
URLQueryItem(name: "body", value: body) | ||
] | ||
|
||
guard let email_url = components.url else { | ||
NSLog("Failed to create mailto URL") | ||
return | ||
} | ||
UIApplication.shared.open(email_url) { success in | ||
// handle success or failure | ||
} | ||
} | ||
|
||
} | ||
Section(header: Text("Why AWSary")){ | ||
Text("I'm an AWS Cloud Consultant and Trainer.\n\nNew AWS Services are released all the time, and sometimes you just want a quick dictionary definition.\n\nI also draw AWS Cloud Architecture diagrams daily on iPad, to explore ideas either with Colleagues, Clients or Students.\n\nGood drawing Applications don't have AWS services logos, so on top of this dictionary I enabled the drag and drop of the logos to 3rd party drawing tools.\n\n This App is a great AWS Cloud Consultant companion tool.\n\nHelp develop this app at [GitHub](https://github.com/tigpt/AWSary/).") | ||
} | ||
Section(header: Text("How to use AWSary")){ | ||
Text("Search for the name of an AWS service, you can open and look for the definition of it. You can also drag and drop the service logo to your favorite drawing application. (Check video below)") | ||
MyYoutubePlayer(youtube_id: "c0SjbhRR3lk") | ||
} | ||
Section(){ | ||
Link("Terms of Use (EULA)", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula")!) | ||
Link("Privacy Policy", destination: URL(string: "https://tig.pt/awsary-privacy")!) | ||
} | ||
// Section(header: Text("AWSary.com")){ | ||
// Text("This is a hobby project from Tiago Rodrigues to help more people learn about Cloud, specialy AWS. Special tanks to tecRacer for supporting the backend.").lineLimit(100) | ||
// } | ||
// Section(header: Text("Help developing this app")){ | ||
// Text("Get involved in this application") | ||
// } | ||
// Section(header: Text("Contact & Help")){ | ||
// Text("FAQ - Frequently Asked Questions") | ||
// } | ||
// Section(header: Text("info")){ | ||
// Text("Acknowledgements") | ||
// Text("Colophon") | ||
// Text("Privacy Policy") | ||
// } | ||
// Section(header: Text("Icon")){ | ||
// Text("Icon 1") | ||
// Text("Icon 2") | ||
// Text("Icon 3") | ||
// } | ||
} | ||
.navigationTitle("Settings") | ||
.navigationBarTitleDisplayMode(.inline) | ||
.toolbar { | ||
ToolbarItem(placement: .confirmationAction){ | ||
Button("Done", action: { | ||
dismiss() | ||
}) | ||
} | ||
} | ||
}.accentColor(Color(red:1.0, green: 0.5, blue: 0.0)) | ||
} | ||
// var body: some View { | ||
// NavigationStack{ | ||
//// VStack{ | ||
//// HStack{ | ||
//// Spacer() | ||
//// Button(action: { | ||
//// dismiss() | ||
//// }){ | ||
//// Text("Done").font(.title3 .bold()).padding(10) | ||
//// } | ||
//// }.background(Color .yellow) | ||
//// ScrollView{ | ||
//// Text("AWSary.com").font(.largeTitle) | ||
//// Text("Multiline \ntext \nis called \nTextEditor") | ||
//// }.background(Color .red) | ||
//// .font(.title) | ||
//// Spacer() | ||
//// } | ||
// Text("hello world") | ||
// }.background(Color .pink) | ||
// .navigationTitle("Settings") | ||
// .toolbar { | ||
// Button("Done", action: { | ||
// dismiss() | ||
// }) | ||
// } | ||
// } | ||
} | ||
|
||
#Preview { | ||
AboutView() | ||
} | ||
|
||
extension Bundle { | ||
public var appName: String { getInfo("CFBundleName") } | ||
public var displayName: String { getInfo("CFBundleDisplayName") } | ||
public var language: String { getInfo("CFBundleDevelopmentRegion") } | ||
public var identifier: String { getInfo("CFBundleIdentifier") } | ||
public var copyright: String { getInfo("NSHumanReadableCopyright").replacingOccurrences(of: "\\\\n", with: "\n") } | ||
|
||
public var appBuild: String { getInfo("CFBundleVersion") } | ||
public var appVersionLong: String { getInfo("CFBundleShortVersionString") } | ||
//public var appVersionShort: String { getInfo("CFBundleShortVersion") } | ||
|
||
fileprivate func getInfo(_ str: String) -> String { infoDictionary?[str] as? String ?? "⚠️" } | ||
} |
11 changes: 11 additions & 0 deletions
11
ios/AWSaryAppClip/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
ios/AWSaryAppClip/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSAppClip</key> | ||
<dict> | ||
<key>NSAppClipRequestEphemeralUserNotification</key> | ||
<false/> | ||
<key>NSAppClipRequestLocationConfirmation</key> | ||
<false/> | ||
</dict> | ||
</dict> | ||
</plist> |
6 changes: 6 additions & 0 deletions
6
ios/AWSaryAppClip/Preview Content/Preview Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict/> | ||
</plist> |
Oops, something went wrong.