Are Swift private features (like Function builders) rejected by the App Store review process? - swift

I'm trying to build some features using function builders (#_functionBuilder included in Swift 5.1).
I know using private framework APIs is disallowed, but does the same apply for private language features?
I have tried looking this up but couldn't find any relevant information on the topic specifically addressing this. Grateful if anyone can help me with this.

Related

Self-hosted framework for translation like google translate api?

I am currently developing an enterprise software. The client stated the need to translate certain texts that we gather from different sources into their home language, or at least into English. Due to GDPR concerns we cannot use external APIs like Google Translate API or DeepL. We need to have either a self-hosted solution or even better, just a python framework that contains translation logic for different languages internally.
Do you know of any such framework?
LibreTranslate seems to be a good option that we will be trying out.

How can we handle api response in both platform in ios and android in kotlin mutlplatform?

Hey I am new in the world of Kotlin Multiplatform mobile. I have experience in development of android field. I am trying to connect Android application and Ios application. I searched and see Ktor is the way to fetch data from server. In android we use Kotlin Sealed Classes for Handling API Responses example in your application and in ios side team use Understanding Swift closures and asynchronous request functions similar to these. I am little bit confused, How can I use this way in common module to use both platform because both platform have Interceptor and many more things. Do I need to write everything from scratch? or Is there any way we can use existing way. My both platforms application is huge project. I don't won't to replace the code. I want to start new api call throught KMM using Ktor. Any suggestion or project would be helpful for me. Thanks
You don't need to write anything from scratch. Basically you will need a separate Network Layer which will be in shared module. It will mainly consists of your request/response models and api call stuff. Here only you can define a sealed class which will provide you if the api is success or failure in your api callback and based on that you can handle your response.
You can refer to this amazing sample for your usecase. You can also refer to this blog for in depth understanding.
If you want to use old Android Code into Kotlin-Multiplatofrm Project you need to do some steps
First Step : you should separate your code into business layer and presentation layer you can know about it by reading clean architecture Android
Second Step : we will put business layer into Shared Module then we will put presentation layer into ANDROID APP
Third Step : you should replace Retrofit Code with Ktor Code
Fourth Step : You should replace Room Code with SqlDlight Code
fifth Step : You Should Write your view in presentation layer with Compose not Xml
then application will be ready to use his business logic into ios
sixth Step : then you can write your swift code into IOS APP
you can look at this code this is not complete code but it will make it clear to you haw you can use
my Kmm Repo at Github
note :
Presentation layer contain view , viewmodel and any Platform dependent tools like workmanger
business layer contain network and caching code like KTOR , SQLDELIGHT and any logic that may be shared between Android and Ios

What's the difference between ActionsSdkApp and DialogflowApp for Google Assistant

In order to build a Google Assistant app, Google provides two different APIs as part of their node.js actions-on-google library :
ActionsSdkApp
DialogflowApp
There have a common interface, but I don't understand what the difference is between the two and why I would use one or the other.
In short, these two objects provide similar (although not identical) methods to handle requests and provide results for two default ways Google allows you to build an Action for the Assistant.
The DialogflowApp object is the one you will likely use for most purposes. It is meant to work with the Dialogflow tool, letting it handle the Natural Language Processing (NLP) components and passing the results, where appropriate, to your webhook. It provides a few methods that are specific to Dialogflow features, such as Contexts, and maps other things to the response format that Dialogflow expects.
The ActionsSdkApp is meant to be used if you are using your own NLP and your webhook is getting things directly from Google (without using Dialogflow). If you need to build an actions.json file, you're using the Actions SDK.
Both have common methods and idioms, such as app.ask() and app.tell() and mapping app.data to session storage and so forth, even if the details of implementing these are different for each type.
You should be using the one that matches the tool that you're using. For most new users - that will likely be Dialogflow and the DialogflowApp object.
Update
Note that the API in the question, the specific objects asked about, and the specific methods talked about in my answer are for the previous version of the library.
The concept of when to use the ActionSDK vs Dialogflow objects in the current library still hold, so the concept behind this question and answer are still valid, but the technical details have changed.
Update - Jun 2020
The library in question is now deprecated, since it no longer works with the current version of Actions on Google (Actions Builder/SDK AoG v3). It still works with Dialogflow (which uses AoG v2) and if you're still using the AoG v2 Actions SDK.
IN SIMPLE TERMS
Use the Actions SDK for one-shot apps. These are apps that provide the required answer directly after being invoked and then stop. They give you just this one result. A typical example would be setting a timer to ten minutes.
Use the Dialogflow for all other apps, for those that are really conversational, where there are multiple paths to follow and where you want your user to provide more information during the conversation.

Writing an api-doc for Swagger

I'm trying to use the Swagger UI, and it says that I should begin by writing an api-doc that describes the exact api for a REST api. The problem is that I have no idea what this means. Is this document written in plain English? Or is there a certain format that will be able to generate the UI?
Thank you!
Swagger is a specification for describing REST APIs. Documentation of the specification can be found here - https://github.com/swagger-api/swagger-spec.
Generally, there are two ways to document your API. If you already have an existing API with code, you can use any of the existing libraries (https://github.com/swagger-api/swagger-spec#additional-libraries) to integrate into your code and generate documentation at run time. Some of those libraries also offer offline generation of such docs.
If you're looking to design an API, or would rather not integrate another library into your application, you can use https://github.com/swagger-api/swagger-editor either locally or with the online version - http://editor.swagger.io.
Once you have the documentation, you can use Swagger UI to visualize and test it.

Iphone Rejected Apps

I update my application from version 1.0 to version 1.1 and I submit my iPhone App to Apple a week ago .Few minutes ago I got this Report from Apple that
We found that your app uses one or more non-public APIs, which is not in compliance with the App Store Review Guidelines. The use of non-public APIs is not permissible because it can lead to a poor user experience should these APIs change.
We found the following non-public API/s in your app: setContentToHTMLString.
If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your application being flagged in future submissions.
Additionally, one or more of the above-mentioned APIs may reside in a static library included with your application. If you do not have access to the library's source, you may be able to search the compiled binary using "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods.
These techniques can help you narrow down where the problematic code resides.
Please tell me, What to do to resolve it?
If you are using:
setContentToHTMLString
Don't use it anymore, if its a private API method and Apple doesn't want you to use it
If you are using a method in the private API, then you will have to find an alternative function. Either from a library or write your own.
If you have written a function named setContentToHTMLString then rename the function (you might like to prefix it- perhaps mySetContentToHTMLString) and change all of the usages over to your new name.
Then you'll be able to resubmit.
setContentToHTMLString is an undocumented method of UITextView. You may need to remove it. You are NOT allowed to access the private API.