AppStore Review Component | Hotwire Native Bridge | SupeRails #216

25/11/2024
bridge (Strada) hotwire native
Transcript
Hello France. So far we have added a bunch of, uh, bridge components to our native application. We have added the NF component that opens a dropdown. We have added the, uh, menu component that opens a model like this. We have added the form component that, uh, gives us a native submit button. And now let's try adding another component for prompting a user to leave a review for our application in the app store. Now, this was, uh, the idea for this episode was, uh, completely taken from Geo Melodi, uh, uh, post on Twitter about, uh, adding the reviews to your hot native application. So, uh, I have, uh, extracted this into a small blog post and let's try introducing this, uh, review prompt component to our application. Again, I'm working based on this, uh, hot native iOS demo application. So first of all, I'm going to go and create a review prompt component in my, uh, uh, demo bridge. In the bridge folder. Going to file a new empty file review component of Swift. I'll paste all of this. We really need, uh, a new library, uh, of, uh, all possible, uh, uh, bridge components that we would, uh, want to use in our applications. I think it would be great to have a library, like a component library of, uh, bridge components. Okay. And then we're going to add the stimulus controller to our web application. So inside JavaScript controller's bridge, I'm adding review prompt controller. Okay. And finally, we can apply it anywhere in our markup. For example, let's do it when visiting, uh, one specific page when we go to, uh, the organization show page. So going to organization slash show. And here, anywhere in the markup, we will add this data controller bridge or review prompt. Now, let's navigate around applica our application. I'll go to new organization. I will go to homepage. Uh, I will go back to organizations. I will open the organization page, and, uh, I would expect to see this, uh, bridge review prompt. Uh, maybe I need to actually restart this application. Oh, yes. Not only this, I should also add the review prompt component to our scene controller. So here I will add you your component self. Okay, now I will restart the application once again, and now it should work. So let's navigate to an organization show page. And, uh, yes. Here you see we get this, uh, uh, model to open the app store and rate the application. Now, you would want to really, uh, render this, uh, component conditionally, uh, on some pages after, uh, uh, user does some kind of positive interaction. For example, Burges says, uh, something on your uh, app. That way he's more likely to give a positive review. Anyway, thanks for watching and see you in the next one.
0
Join the conversation
Sign in to leave comments and save lessons to your watchlist.
We collect your email address, name and username to create your account. We do not share your email address with anyone else.