Drag and drop to Spotify app icon - api

I'm making a Spotify app and I want to be able to drop something onto the app icon. There are examples of dropping things to the app, but how do I get the icon to react to dropping?
Adding the event listener
models.application.addEventListener('dropped', function() {
doSomething();
});
doesn't seem to do it. Other apps have it though, so there is a way.

You need to add the AcceptedLinkTypes attribute to the manifest.json file of your Spotify app.
For instance, if your app wants to react to drag&drop of playlists, you would do:
{
"AcceptedLinkTypes": ["playlist"],
...
}
Currently, album, artist, playlist, track and user are supported.
If the changes in AcceptedLinkTypes don't take any effect, try restarting the client.

Related

How to publish LocalScreenShare tracks from IOS to Web browser in React-Native using Twilio

I want to integrate Screen Share feature in my react-native application in which I am using Twilio for video communication. In Web we are able to achieve this by following these steps.
1 : We get the media device stream using
navigator.mediaDevices.getDisplayMedia({
video: true,
});
2 : Then we get the first stream tracks using
const newScreenTrack = first(stream.getVideoTracks());
3 : After that we set this newScreenTrack in some useState
const localScreenTrack = new TwilioVideo.LocalVideoTrack(
newScreenTrack
);
4 : After that we first unpublish the previous tracks and publish the new tracks using
videoRoom.localParticipant.publishTrack(newScreenTrack, {
name: "screen_share",
});
5 : And finally we pass these tracks in our ScreenShare component and render these tracks to View the screenShare from remote Participant.
I need to do the same thing in my react-native application as well. Where if localParticipant ask for screenShare permission to another participant. Participant will accept the permission and able to publish the localScreenShare tracks.
If anyone know this please help me in this. It would be really helpful. Thank you
I think this is an issue with the react-native-twilio-video-webrtc package. It seems that, as you discovered in this issue, that screen sharing was previously a feature of the library and it was removed as part of a refactor.
Sadly, the library does more work than the underlying Twilio libraries to look after the video and audio tracks. The Twilio library is built to be able to publish more than one track at a time, however this React Native library allows you to publish a single audio track and a single video track using the camera at a time.
In order to add screen sharing, you can either support pull requests like this one or refactor the library to separate getting access to the camera from publishing a video track, so that you can publish multiple video tracks at a time, including screen tracks.

how to interact with "Reminder me" in CallKit like whatsapp

My App is compatible with CallKit after iOS 10.0. However, I meet with a problem:
When there is an incoming call, I just click the "reminder me" button,
then, I open the system app "Reminders", there will be one record of my app call, But how can I set my app icon here and make the icon clickable to call the other, just like “whatsapp” shows~
I was having the same issue and solved it by letting iOS now my app can make calls. I did this adding the 'NSUserActivityTypes' array to the info plist file with with these entries: 'INStartAudioCallIntent' and 'INStartVideoCallIntent'.
This is how it looks like:
With this, iOS started showing my app icon in the Reminders app. After that you can implement in your app delegate the -application:continueUserActivity:restorationHandler: (or in Swift, application(_:continue:restorationHandler:)) method to handle the received action and start a call.

How do I notify users of new content available in tvOS apps from the home screen?

Push notifications have been left out of tvOS (understandably so) but the docs seem to contradict themselves in alerting users to the fact that there is something new available in your tvOS app.
Here it seems to say that you can add an app badge: https://developer.apple.com/library/prerelease/tvos/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/WhatAreRemoteNotif.html
Here it says they've been removed from UIKit: https://developer.apple.com/library/prerelease/tvos/releasenotes/General/tvOS90APIDiffs/Objective-C/UIKit.html
Removed UIApplication.applicationIconBadgeNumber
Assuming the badge approach is not supported in this release, does anyone know the best practice for alerting a user that there is new content in your app without the user taking an explicit action? ie focusing on the app and showing them something in TopShelf?
I encountered the same problem and dived into this. Probably your best way is to update the topshelf with latest items, which is my way to solve this for now. You can use network calls to update the topshelf with content from your backend.
This depends on the type of application. E.g. showing the latest top movies for a movies app.
You can trigger an update of the topshelf after your network call completed using the following code:
NSNotificationCenter.defaultCenter().postNotificationName(TVTopShelfItemsDidChangeNotification, object: nil)
Make sure to implement the TVTopShelfProvider which should be clear using the following documentation:
This protocol is adopted by the principal class of an app’s TV Services extension. Apps that implement this extension can provide dynamic content to the Top Shelf element rather than having the system use the static image submitted with the app. The topShelfStyle property specifies the interface style you want, and the topShelfItems property specifies the content items to display. Whenever you change the content provided by the extension, post a TVTopShelfItemsDidChangeNotification notification to prompt the system to reload your content.
Icon badges are removed for app icons, push notifications as well (except for silent push notifications).

How to open the apple app store internally using a modal segue

I am currently making an app that recommends other apps to download on the apple app store. I assumed that the only way for users to download these linked apps was to call the iTunes URL of the particular app -> the apple app store would then open pushing the original calling app into the background -> then the user would press the download button here as per normal.
Then I was playing with the app "App Hero" and they do something I thought wasn't possible. You can actually download another app to your device without ever leaving the "App Hero" application. I thought this was impossible due to sandboxing. They have a modal segue to what appears to be an embedded app store where you can commence installation of another app. This "embedded" app store doesn't have the usual UITabBar running along the bottom but everything else is basically the same.
Does anyone have any idea how they would have achieved this? It doesn't appear to be a UIWebView, perhaps I am wrong. And is this against any of the apple regulations?
*This is no way an advertisement for "App Hero". I am genuinely impressed/confused how they are able to do this and would love this functionality in my own app if it is allowed.
The class you are looking for is called SKStoreProductViewController. Docs here.

equivalent to android's share intent concept for iPhone using titanium?

I want to add share content functionality in my iOS app. I am developing an app in titanium for iPhone. I want to add a share button that when a user clicks will open a dialog box contains many different option like Facebook, twitter, email , and print.
Unless this has been included in the Appcelerator Framework, you are going to have to write a module
"Share Screen" iOS 6
There is a module for this that wraps the Social.framework on iOS. Ive used it in my own apps and its quite nice. Find it here.
And a small example of how to make it work.
var Social = require('com.0x82.social');
Social.showActivityItems({
activityItems : ["http://stackoverflow.com"]
});
Social.addEventListener('activityWindowClosed', function(e) {
if (e.completed) {
alert('Shared successfully');
}
});