What solutions are there for adjusting text in an app without having to dive into code? [React Native] - react-native

First of all this is my 1st stackoverflow post so sorry if I am missing context or do if the question is too out of the ordinary.. Onto some context and example use case for my question.
Context
I'm making a simple app for an uni assignment in React-Native but one of the requirements client we are making it for is that the text (copy) in the app can be adjusted by him after we deliver it to him.
Example Use Case
They want to change the text on the welcome screen from "Welcome, [Name]" to "Hello there, [Name]". But they aren't technical so they expect to be able to change this in a simple UI.
I've tried googling for solutions but keep finding Localization solutions instead and all I've found so far require in-code edits.
Example:
🌍 react-native-localize & Expo Localization Docs
Any help/pointers are much appreciated!

There are two basic ways to solve this issue.
Create an API that the app calls to get the text. Make web or app tools for the client to edit the text in the API. This is usually called a CMS (content-management solution). There are a huge range of options, including building your own.
Pros:
the client can maybe manage their own content without intervention... sometimes
content changes are "instant" - without an app release
Cons:
non-trivial to plan and set up
requires support/maintenance
additional costs for hosting
additional app complexity (need to think about error states, caching, polling?)
app NEEDS to be online to have content
OR
The client submits a ticket for the text changes and a developer makes them.
Pros:
doesn't require the creation/ maintenance of additional tools
app doesn't need to make network requests for content
Cons:
changes take longer and require a new release of the app

Related

Setting values whitout UI interaction. Cypress app actions

Guys! I'm kinda new in cypress and was looking in this link (https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/ )to see the diff between page objects and app actions. Since app actions are brand new, i was not able to find any documentation to help me out. In the link above, there was an example of how to predefine values ​​on the page so no UI interaction is required. I was able to follow the steps and realize the changes here, but i don't know how to do that outside this example.
How could i manipulate cypress application to do that?
Skimming the article, the idea of application actions is to export an API/hooks from your application that your test can use to interact with the app (its model, state etc.), for the purpose of speeding up certain workflows (such as seeding the model), awaiting certain events etc.
There's nothing magical about it, but it requires knowing your app architecture β€” what you need to export (i.e. expose on the window object), and how to interact with it. If you're not the developer of the app (e.g. you work in a separate QA department), and treat the app as a black box, then you'll need to discuss with the dev team how best to implement this.
Each app is different, and depending on the app architecture (What framework does it use? How does it store state/model? etc.), each solution will be different.

google home reading from website

I'm currently working on a project where my main focus is to create an Action for Google Home which can be invoked and asked to read out some articles (chosen previously from a list, also by voice) from a particular website.
I was wondering if it was possible, or if it were already some similar projects.
What I'd like to do is something like the feature in Pocket or instapaper, where you can make the device read the article for you.
I also thought to make something like a database with all the articles I'm interested in, which auto-updates itself whenever a new article is posted, but my main concern now is to be able to separate the articles in various lists, parse the article and in the end implement text to speech into the Action.
Also some implementations with 3rd party services and apps would be useful.
Please ask me if anything isn't exactly clear, english is not my first language.
Yes, this is possible. Not necessarily easy, but possible.
First - there is nothing in the Actions on Google library or in Google Home that will automatically scrape a website. That will be up to you.
Second - Responses from your Action are limited in how much they can send at a time.
If you're having it do text-to-speech, you're limited to two "text bubbles" of 640 characters each before the user has to reply. You should keep well below that and should probably stick to just one "text bubble".
If you're playing an audio cut, then you're limited to two minutes.
You can work around both of these limitations by using the Media Response. With TTS, you would play a portion of the text, a brief Media response, at the conclusion of which, your server would be triggered to send the next chunk of text. If it is all recorded, you can just send the longer audio as the Media.
Be advised, however, that if you're using the inline editor or using Firebase Cloud Functions (which the inline editor uses), that by default you're not able to access most sites outside Google's network. You need to upgrade to a paid plan to do so. I suggest the Blaze plan which is pay-as-you-go, but includes a free tier which is typically good enough for development work and light production usage.

Shopify App Necessary? Hard-code into Theme?

I have much experience developing for WordPress but this will be my first project developing for Shopify.
I will be customizing a 3rd-party Shopify Theme with custom functionality as per the client's website needs. I've been reading much documentation but I am still a bit confused about Shopify Apps...
My question is:
Do I need to build an App to extend the functionality of my theme, or can I just hard-code the new functionality directly into the theme? Is there any reason to develop an App for functionality that will only be used on my theme?
I thank you very much for your advice.
Do I need to build an App to extend the functionality of my theme, or can I just hard-code the new functionality directly into the theme?
Short answer: Yes. (Damn that mathematician's response!)
Is there any reason to develop an App for functionality that will only be used on my theme?
Longer answer: Sometimes, yes.
That wasn't very helpful
Longest answer: True. Let's break it down a little more, then.
Without knowing what you need to do, I can't offer a concrete yes-or-no answer to the question, "Should I build Feature X as an app?"
If you...
Need to add, modify or delete any objects that require admin privileges (including products, variants, collections, orders, etc.), or...
Need to listen for any of Shopify's webhooks, or...
Need to store data in an external database for any reason...
... you will need an app to have the permissions required to access and manipulate data at this level.
However, if you...
Can do everything you need with the existing Shopify objects, and...
Need few or no settings to control the desired behaviour...
... you would not need to create an app. Shopify themes have some powerful tricks & tools available to you, including:
The ability to create custom endpoints for any of the main types of objects to get the data you need;
Easily-edited settings_schema file to add arbitrary configuration variables to help control your mini-app;
Javascript endpoints to let you add, remove & edit products in the cart
Hopefully this quick breakdown helps you decide if you need to create an app or not. (And to anyone who does need to make a single-site app, remember that Shopify lets you create 'Private Apps' that don't have to go through the app store process to get widespread approval)
I thank you very much for your advice.
You're welcome! Hopefully it proves to be helpful. Good luck!

Ampersand.js admin panel makes it a 2 page app?

Ampersand being a single page application framework, would I begin messing things up by creating a separate page that will have just about as equal amount of functionality not even necessarily related to the visitor page (small business application that may wish to have additional management related features)?
Well, as always, it depends. Basically, if your admin pages don't add much overhead to the size of your app, then you can keep it a SPA. The most "heavy" parts are likely to be different libraries that you use. And if those libraries are the same both for admin and for simple users, then your own views and stuff will not really add much (especially if you are minifying and gzipping everything, and you should). But if you use, let's say, a tinymce + full lodash + ... for the admin purposes, while you don't for normal visitors, then possibly you should put it in two separate apps since you don't want your visitors to load extra 300kb.
From the security point of view it should not be a problem since all the requests to your API should be checked server-side. So even if somebody gets access to the admin views they should be unable to get or post anything they don't have rights for.
P.S. As browserifying can take a while, I really recommend you using the watch option if you are not doing it yet, it will really speed up the compilation when you change code

To Make an API Centric Application or Not? - Laravel

So. I have embarked on the journey of learning Laravel in the last couple of weeks, and am thoroughly enjoying it.
It has come time for a site redesign and I thought it was about time to tighten up some of our functionality, so I am making the switch from CodeIgniter to Laravel.
I was wondering whether it is worth starting off with a RESTful API layer in Laravel (easy enough to create) and use it as a base even for the web application. In the future we are likely to build a mobile app that will need to use the API. So:
Is it worth having the web application connect to the API
and what is the easiest way/s to make calls to the API without having to write a bazillion
lines for cURL everytime I want to make a request?
It is definitely worth it.
I am currently redesigning a messy PHP code for an established hosting company turning it into beautiful Laravel code. I already have a mobile app working with it - Laravel makes it easy to return JSON data with one line -
Response::json('OK', 200);
or
Response::eloquent(Auth::user());
or
$tasks = Task::all();
Response::eloquent($tasks);
You don't need to use CURL as far as I know.
You can make all requests with simple AJAX, jQuery would simplify that.
Also using some MVC JS framework would help you make the application code structure more elegant for the client side, and the advantage is that you can easily package that into PhoneGap when you are ready to have your API take some real testing.
Today I posted on my blog about a simple example that you can try to see if this approach is worth your time : http://maxoffsky.com/code-blog/login-to-laravel-web-application-from-phonegap-or-backbone/
Check it out and accept the answer if you think it's on the right track.
As always, your results may vary, but this is exactly what I'm going through at the moment. I'm migrating a large .Net site with this API architecture and I've decided to keep it for Laravel.
I personally decided for this because:
More scalable. I can setup api.domain.com and then add additional
boxes/vm/whatever as our traffic grows. In fact, you could load
balance just the api by "round robin" or multiple dns entries for
that domain.
Future proofing for new sites and apps. Sounds like you're in the
same situation. I can see an app or two being added in the next year
or so.
Lost cost. You'll already be laying out your controllers, so really
it can be just a matter of setting them to RESTful and making small
tweaks to accommodate.
To be fair, some counter points:
Possibly additional load time, from processing through the API, though this should be minimal.
Additional security items to consider if you'd like to lock things down to just your app.
Either way, welcome to Laravel!
and what is the easiest way/s to make calls to the API without having to write a bazillion lines for cURL everytime I want to make a request?
#Sneaksta try postman chrome extension for calling rest services. you can create forms in this extension and pass data from these forms to you Rest services
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?utm_source=chrome-ntp-icon