Comments (5)
Hi @thomasmo3!
I'd need to look into that, not 100% sure what that would look like. But I'm guessing something along these lines would help get it to work!
https://www.captechconsulting.com/blogs/combining-swiftui-with-viewcontrollers
Thanks,
Phil
from ios-sdk.
Hi @manavo,
thanks for your quick response!
That should work, but I think there might be a better way to add it into a SwiftUI view directly. Currently, I'm also not sure how. Although, this would be great for other users as well to be added to the instructions of Doorbell integration for iOS, I think.
all the best,
Thomas
from ios-sdk.
Hi @thomasmo3,
I've just been doing some tests for this, and this seems to work for SwiftUI:
// In your View, define a button or something to trigger the feedback dialog
Button(action: feedback) {
Label("Feedback", systemImage: "plus")
}
// In the same struct, create a function that can be called to initialize Doorbell
private func feedback() {
var currentKeyWindow: UIWindow? {
UIApplication.shared.connectedScenes
.filter { $0.activationState == .foregroundActive }
.map { $0 as? UIWindowScene }
.compactMap { $0 }
.first?.windows
.filter { $0.isKeyWindow }
.first
}
var rootViewController: UIViewController? {
currentKeyWindow?.rootViewController
}
let appId = "ID-HERE"
let appKey = "KEY-HERE"
let feedback = Doorbell.init(apiKey: appKey, appId: appId)
feedback!.showFeedbackDialog(in: rootViewController, completion: { (error, cancelled) -> Void in
if (error?.localizedDescription != nil) {
print(error!.localizedDescription);
}
})
}
Would something like this work for you?
Thanks,
Phil
from ios-sdk.
Thank you, @manavo !
Works pretty well. This sould be added to the documents for your users.
I decided to create my custom UI now and directly use your library to send the feedback.
Your provided feedback dialog does not look really beautiful IMHO, maybe this might need some improvement :) (Also, I'm not creating an issue for that now...
All the best and read you soon,
Thanks, also for our email communication,
Thomas
from ios-sdk.
Great to hear that it works at least, it's a good starting point! Thanks for confirming @thomasmo3!
I'll add this to the docs for now since it gets it working. And yes I do agree that it wouldn't really win any design awards, but I'll see what I can do about that too :)
Thanks,
Phil
from ios-sdk.
Related Issues (12)
- How to alert when message has been sent? HOT 7
- Message when there is no Internet Connection is too long HOT 5
- No support for dark mode in default dialog HOT 2
- Custom form email validation doesn't return an error HOT 2
- Sending tags from sdk HOT 1
- App crashes when sending feedback on iOS 12.5.3 HOT 9
- XCode warnings regarding Umbrealla headers HOT 9
- Deprecated API HOT 5
- Swift support HOT 13
- Crash if completion block is nil HOT 3
- Turn on TravisCi HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-sdk.