question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Open sms app with longer text, Ionic toolbar disappears. cordova-sms-plugin

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

I am using this cordova-sms-plugin to send sms from my app. When I send a text which is shorter, everything works as expected but when text is longer and sms app opens, coming back to app will hide the toolbar irrespective of whether I sent the sms or not. When inspected in Safari, I can see the toolbar if I add padding-top from ion-safe-area-top to 162px.

Expected Behavior

Toolbar shoudlnt disappear. As per my understanding, size of webview is being changed on opening sms app with longer text.

Steps to Reproduce

install cordova-sms-plugin open sms app by using a longer text message to send. come back to app

Code Reproduction URL

No response

Ionic Info

Ionic: Ionic CLI : 6.14.1 (/Users/dijitalbrains/.nvm/versions/node/v12.16.1/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.6.6 @angular-devkit/build-angular : 0.1002.3 @angular-devkit/schematics : 10.2.3 @angular/cli : 10.2.3 @ionic/angular-toolkit : 3.1.1

Capacitor: Capacitor CLI : 3.2.5 @capacitor/core : 3.2.5

Utility: cordova-res (update available: 0.15.3) : 0.15.1 native-run : 1.5.0

System: NodeJS : v12.16.1 (/Users/dijitalbrains/.nvm/versions/node/v12.16.1/bin/node) npm : 6.13.4 OS : macOS Big Sur

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
umairrafiq1133commented, Nov 17, 2021

@sean-perkins Thanks. Issue is fixed for me.

1reaction
sean-perkinscommented, Nov 16, 2021

@umairrafiq1133 @subhankhalid402

I have found a resolution to the issue. It appears that both MFMessageComposeViewController and MFMailComposeViewController will cause the webview to resize between iOS 14 to 15.

You will need to install @capacitor/keyboard into your project(s) to resolve this issue.

npm i @capacitor/keyboard

Next, before you open the SMS plugin/keyboard, set the resize behavior to none.

import { Keyboard, KeyboardResize } from '@capacitor/keyboard';

...

async openSmsApp() {
  await Keyboard.setResizeMode({
    mode: KeyboardResize.None
  });
  ...
  await this.smsPlugin.send(phoneNumbers, message, options);

  await Keyboard.setResizeMode({
    // Change this value if you aren't using ion-app
    mode: KeyboardResize.Ionic
  });

Remember to sync your capacitor plugins after installing the dependency.

npx cap sync ios

<video src="https://user-images.githubusercontent.com/13732623/141926563-c22019c5-de78-49fd-8e9f-86b013b4e39d.mp4"></video>

Let me know if this resolves the issue on your end. I’ve checked locally with both the Cordova and Capacitor plugin, on iOS 15.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - Ionic/cordova-sms-plugin Open sms app with longer text ...
When inspected in Safari, I can see the toolbar if I add padding-top from ion-safe-area-top to 162px . I have tried hiding/showing statusbar ......
Read more >
SetPages with NavController - Ionic Framework - Ionic Forum
After login, I have in HomePage the ngInit function that searches the data in this external API. When I navigate in other pages...
Read more >
Cordova Community Plugins - Ionic Framework
For the Cordova user community, our collection of TypeScript wrappers for open source Cordova core plugins easily add native functionality to any Ionic...
Read more >
Viewing online file analysis results for '556.apk'
Found an indicator for SMS sending capabilities ... READ_CONTACTS, Allows an application to read the user's contacts data. android.permission.
Read more >
Typeerror: Object(..) Is Not A Function At Inapppurchase2.Get
Ionic 4/ Angular cli based app make sure that the css is loaded into the ERROR Error: ... is not a function however...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found