Today Widget not Showing Contents When PushNotificationIOS activated (React Native) - ios

I've been having trouble understanding why my today widget isn't working after integrating the react-native-push-notification into my application. Has anyone experienced this problem? For example, I'm trying to display something as simple as: <Text>Hello World</Text> in my today widget. I followed the procedures to implement the widget in this article. https://medium.com/#jamesrochabrun/local-notifications-are-a-great-way-to-send-notifications-to-the-user-without-the-necessity-of-an-b3187e7176a3
I used zo0r/react-native-push-notification to implement local notification functionality.

Make sure the linked frameworks and libraries are the same for both the widget and the project in which it resides. Once I made them the same, the widget contained the react-native view.

Related

How to properly discontinue a widget on iOS?

I have decided to remove a widget extension from my app. So this particular widget type is no longer supported. So I completely removed the extension from my project, including all the code and the respective target.
Installed Widgets Break After Update
When I now update my app with this new version, the old widgets are still there, but blank because they can't update anymore as there is no more widget extension or code to handle the updates.
Is there any way to
automatically remove all widgets of a given extension from the user's home screen or
at least declare the widget somehow as "deprecated" so the widget only displays a warning message that it's no longer supported?
The Best Thing I Could Come Up With
My emergency plan is to keep the extension in my app for a while, replace the existing widget UI with the warning text and set the supported widget families for this widget to an empty array. This should prevent the widget from appearing in the widget gallery. Then, a couple of months later, when 95% of my users have updated and hopefully read the warning, I can finally delete the widget extension. This is the best idea I could come up with, but it's far from ideal as it will still break for some users who haven't updated yet when I delete the extension.
So is there a robust way to remove a widget extension without breaking the widgets my users have already installed on their home screen?
After submitting a TSI, according to Apple: until now there is no clean way. Springboard is supposed to remove them, but there are still cases where it fails to do so. I submitted a bug report.

How can you use iOS 16's UIPasteControl with React Native?

iOS 16 introduces UIPasteControl as a way of avoiding the paste permission dialog appearing when an app programmatically accesses the clipboard contents.
To enable UIPasteControl, its target needs to be set to an object that conforms to UIPasteConfigurationSupporting, so typically a UIResponder like UIViewController or UIView. Then you would ensure the object's pasteConfiguration is set to allow the types you want to paste.
I've got a React Native app so there are no native iOS UIView etc. type objects being used directly.
If, for example, a paste button was to be added to a React Native view, then how can that be hooked up so that its using UIPasteControl?
If we consider the latest version of react native, there might we not see the functionality for UIPasteControl as per new iOS versions.
for this, I guess we should create our implementation and export the functionality to react-native to accomplish this requirement.
If you have hands-on experience with iOS native development and custom native UI views implementation in React Native then you can check out the following blog about the UIPasteControl implementation in native, to implement it natively and export it to React Native.
UIPasteControl(Native) demo : https://blog.kylelanchman.com/how-to-use-uipastecontrol-in-ios-16/

How to play Youtube videos using Expo

I am trying to use the react-native-youtube component in my expo project. However, I couldn't get it to work. All I have so far is a black screen with red borders. I tried following the video instructions on online however, expo doesn't have an iOS or Android folder, which means I can't open it in XCode and fiddle with it. How can I play youtube videos using expo? As you might have noticed from my question I'm new to react-native using expo.
At the moment, YouTube is not supported by Expo. You can either eject the project and install the react-native-youtube library or load your videos from a WebView like this:
<WebView
style={{flex:1}}
javaScriptEnabled={true}
source={{uri: 'https://www.youtube.com/embed/ZZ5LpwO-An4?rel=0&autoplay=0&showinfo=0&controls=0'}}
/>
For anyone still looking for this, try this package with expo support
https://github.com/LonelyCpp/react-native-youtube-iframe
A wrapper of the Youtube IFrame player API build for react native. Uses the webview player which is known to be more stable compared to the native youtube app.
As the new expo SDK has support for the modern community maintained webview, it should work seamlessly across platforms
The current way to get a YouTube video in a React Native application is to use React Native's WebView component in your project.
Here is a snack that shows an example of how the WebView works using an Instagram signup flow as an example: https://snack.expo.io/HJRKKTmAx.
I'm sorry if that wasn't exactly what you're looking for :(
To use react-native-youtube component you would have to detach your Expo project ExpoKit:
ExpoKit is an Objective-C and Java library that allows you to use the Expo platform and your existing Expo project as part of a larger standard native project — one that you would normally create using Xcode, Android Studio, or react-native init.
More information here: https://docs.expo.io/versions/v18.0.0/guides/detach.html
I hope these two options solve your problem, let me know if theres any other way I can help.
(work only in website)
Install npm i react-player
basic usage
import ReactPlayer from 'react-player'
export default function App() {
return (
<ReactPlayer url='https://www.youtube.com/watch?v=ysz5S6PUM-U' />
);
}
Props = https://www.npmjs.com/package/react-player

How to make a today widget of iOS8 automatically appear in today panel after host app is installed

My app contains a today widget. After installation of the app, the widget is not loaded by default. I must add it manually in edit area of Today widgets.
Is it possible to make the widget automatically appear after I install my app?
No unfortunately this is not possible.

Xamarin.Android app with MvvmCross and Pixate

I am currently experimenting with Pixate, trying to add to our existing app that is built with Xamarin.Android and uses MvvmCross. Without Pixate, the app works correctly. As soon as I make the init call for Pixate, Mvvmcross will throw null exceptions in MvxSpinner method calls, and the app doesn't seem to bind to the list view or spinner. I am wondering if there is anyone that has a working Xamarin Android application that uses both Mvvmcross and Pixate, it seems to me there's a conflict going on between the two libraries. Just wanted to confirm and see if anyone else experience similar issues. Thanks!

Resources