How to open the companion app and go back in from a keyboard extension in iOS
So, I have this requirement where a keyboard extension must be able to open it's companion app and have the user take a specific action in there and then be able to go back to whatever previous app was opened and input some text in the previously selected text field.
Basically, if you take a look at Scandit Keyboard Wedge you'll see that behaviour: the user opens can press the "Scan" button on the custom keyboard and is taken in the companion app. Once a barcode is scanned the app automatically goes back to the previous opened app and inputs the barcode string into the text field that was being edited.
Now, reading through Apple's documentation I see a mention saying that a keyboard extension is not permitted to open another apps. Does this include it's own companion app?
Also, even so, I'm not really sure how I can have the keyboard extension open a custom URL since UIApplication.shared
is not available in the keyboard extension.
Now, my second problem is, how does the companion app go back to the previously opened app?
Same goes for Google's own custom keyboard. Now, I found a question about this one here on SO. The answer suggests that this is using a private API to handle this thing. But then I'm curious: how did this even go throw Apple's review process? Am I expected to have my app rejected?
ios swift keyboard ios-extensions
add a comment |
So, I have this requirement where a keyboard extension must be able to open it's companion app and have the user take a specific action in there and then be able to go back to whatever previous app was opened and input some text in the previously selected text field.
Basically, if you take a look at Scandit Keyboard Wedge you'll see that behaviour: the user opens can press the "Scan" button on the custom keyboard and is taken in the companion app. Once a barcode is scanned the app automatically goes back to the previous opened app and inputs the barcode string into the text field that was being edited.
Now, reading through Apple's documentation I see a mention saying that a keyboard extension is not permitted to open another apps. Does this include it's own companion app?
Also, even so, I'm not really sure how I can have the keyboard extension open a custom URL since UIApplication.shared
is not available in the keyboard extension.
Now, my second problem is, how does the companion app go back to the previously opened app?
Same goes for Google's own custom keyboard. Now, I found a question about this one here on SO. The answer suggests that this is using a private API to handle this thing. But then I'm curious: how did this even go throw Apple's review process? Am I expected to have my app rejected?
ios swift keyboard ios-extensions
add a comment |
So, I have this requirement where a keyboard extension must be able to open it's companion app and have the user take a specific action in there and then be able to go back to whatever previous app was opened and input some text in the previously selected text field.
Basically, if you take a look at Scandit Keyboard Wedge you'll see that behaviour: the user opens can press the "Scan" button on the custom keyboard and is taken in the companion app. Once a barcode is scanned the app automatically goes back to the previous opened app and inputs the barcode string into the text field that was being edited.
Now, reading through Apple's documentation I see a mention saying that a keyboard extension is not permitted to open another apps. Does this include it's own companion app?
Also, even so, I'm not really sure how I can have the keyboard extension open a custom URL since UIApplication.shared
is not available in the keyboard extension.
Now, my second problem is, how does the companion app go back to the previously opened app?
Same goes for Google's own custom keyboard. Now, I found a question about this one here on SO. The answer suggests that this is using a private API to handle this thing. But then I'm curious: how did this even go throw Apple's review process? Am I expected to have my app rejected?
ios swift keyboard ios-extensions
So, I have this requirement where a keyboard extension must be able to open it's companion app and have the user take a specific action in there and then be able to go back to whatever previous app was opened and input some text in the previously selected text field.
Basically, if you take a look at Scandit Keyboard Wedge you'll see that behaviour: the user opens can press the "Scan" button on the custom keyboard and is taken in the companion app. Once a barcode is scanned the app automatically goes back to the previous opened app and inputs the barcode string into the text field that was being edited.
Now, reading through Apple's documentation I see a mention saying that a keyboard extension is not permitted to open another apps. Does this include it's own companion app?
Also, even so, I'm not really sure how I can have the keyboard extension open a custom URL since UIApplication.shared
is not available in the keyboard extension.
Now, my second problem is, how does the companion app go back to the previously opened app?
Same goes for Google's own custom keyboard. Now, I found a question about this one here on SO. The answer suggests that this is using a private API to handle this thing. But then I'm curious: how did this even go throw Apple's review process? Am I expected to have my app rejected?
ios swift keyboard ios-extensions
ios swift keyboard ios-extensions
asked Nov 14 '18 at 13:32
Mihai FratuMihai Fratu
6,84422951
6,84422951
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301433%2fhow-to-open-the-companion-app-and-go-back-in-from-a-keyboard-extension-in-ios%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301433%2fhow-to-open-the-companion-app-and-go-back-in-from-a-keyboard-extension-in-ios%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown