Git Product home page Git Product logo

appshortcutsplugin's People

Contributors

adenearnshaw avatar galadril avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

appshortcutsplugin's Issues

Multiple navigation stacks

At least on Android, every time a shortcut is pressed, with the application in memory, the constructor is initialized again with a new navigation stack. Then the shortcut page opens, but if I go back, it goes back to the previous navigation stack.

Is there a way to remove the old navigation stack? Or add the shortcut page to the existing stack?

Thanks and regards.

Add Tag property to Shortcut classe

Each Shortcut has a ShortcutId property, which is set internally as it needs to be unique every new Shortcut instance.

As highlighted in #19 if a user uninstalls and re-installs an app that's only storing a history of its pins locally, there's no way to tell if a business object has already been pinned.

Add a "Tag" property to the Shortcut whose value can be assigned by the user for their own comparison purposes.

[Question] How does it works with MasterDetail Template?

Description

it opens the DetailPage inside the DetailPage
even if i select another shortcut(like the About page in the GIF)
it show that page with a back button and when i press that back button result is the same :(
i think i'm doing something wrong or missing but i don't know what.

The Code

using Plugin.AppShortcuts;
using Plugin.AppShortcuts.Icons;
using System;
using System.Linq;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamNote.Views;

namespace XamNote
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class App : Application
    {
        public const string AppShortcutUriBase = "mhr://XamNote/";
        public const string ShortcutOption1 = "Note";
        public const string ShortcutOption2 = "About";

        [Obsolete]
        public App()
        {
            AddShortcuts();
            InitializeComponent();
            MainPage = new MainPage();
        }

        public async void AddShortcuts()
        {
            if (CrossAppShortcuts.IsSupported)
            {
                var shortCurts = await CrossAppShortcuts.Current.GetShortcuts();
                if (shortCurts.FirstOrDefault(prop => prop.Label == "Note") == null)
                {
                    var shortcut = new Shortcut()
                    {
                        Label = "Note",
                        Description = "Go to Home",
                        Icon = new HomeIcon(),
                        Uri = $"{AppShortcutUriBase}{ShortcutOption1}"
                    };
                    await CrossAppShortcuts.Current.AddShortcut(shortcut);
                }

                if (shortCurts.FirstOrDefault(prop => prop.Label == "About") == null)
                {
                    var shortcut = new Shortcut()
                    {
                        Label = "About",
                        Description = "Go to About",
                        Icon = new ContactIcon(),
                        Uri = $"{AppShortcutUriBase}{ShortcutOption2}"
                    };
                    await CrossAppShortcuts.Current.AddShortcut(shortcut);
                }
            }
        }

        protected override void OnAppLinkRequestReceived(Uri uri)
        {
            var option = uri.ToString().Replace(AppShortcutUriBase, "");
            if (!string.IsNullOrEmpty(option))
            {
                MainPage = new NavigationPage(new MainPage());
                switch (option)
                {
                    case ShortcutOption1:
                        MainPage.Navigation.PushAsync(new ItemsPage());
                        break;

                    case ShortcutOption2:
                        MainPage.Navigation.PushAsync(new AboutPage());
                        break;
                }
            }
            else
                base.OnAppLinkRequestReceived(uri);
        }
       
    }
}

ScreenShot

5875307526244796268

Does not display shortcuts iOS 12 ?

// OK it seems the emulator is not able to react to 3D Touch that's certainly why it does not work.
// You can certainly close this issue (or let some message to warn users this does not work on emulator

Bug Information

Version Number of Plugin: 1.0.0.3
Device Tested On:
Simulator Tested On: iPhone 8 iOS 12.0
Version of VS: latest, up to date
Version of Xamarin: 3.3.0.912540
Versions of other things you are using:

Steps to reproduce the Behavior

Launch demo app, show monkey details, Pin, all is right, no error message, no error in the code (tracking executed code in debug mode, no failure)

Expected Behavior

See something like a shortcut on the iPhone screen

Actual Behavior

Nothing. Monkey is pinned but not shortcut is displayed

Code snippet

Screenshots

nothing to see

Additional notes

Perhaps there is something with iOS 12, I can't test on prior versions.
Long press on Icons does not show anything (just moving icons on the screen), iOS does not react as Android or UWP that's ok. But Where are the shortcuts to be displayed ?
As there is no screen capture along with your sample code it is hard to tell what to expect visually, what should be seen on screen and how to access shortcuts with iOS...

Of course, thanks for this plugin !
And thanks in advance for your answer
Regards
Olivier

[Bug] Menu items not navigating in UWP

Description

Menu items not working in UWP!

Bug Information

Version Number of Plugin: 1.0.0.3
Device Tested On: PC
Version of VS: 16.5.4
Version of Xamarin: 4.6

Steps to reproduce the Behavior

  1. Create some AppShortCuts in App.Xaml.CS
  2. RightClick on the App Tile
  3. Click one of the short cuts
    and all of them navigates the app to the main page

How to get rid of old pins after reinstallation?

Bug Information

Version Number of Plugin: 1.0.0.3
Device Tested On: Windows UWP
Simulator Tested On: No
Version of VS: 2019
Version of Xamarin: 4.5.0.495
Versions of other things you are using:

Steps to reproduce the Behavior

Run the Sample App from VS 2019 and Pin some of the Monkeys
Uninstall the App
Run the Sample App from VS 2019 again and Pin some more Monkeys

Expected Behavior

Pins from the old installation are gone and only the new Pins are pinned
In the App, these pins can be unpinned

Actual Behavior

The Pins from the old installation seams to be stored somewhere and are replied again to the App Icon on right click of the mouse
While Running the new Installation, the saved pins should be possible to unpin. But the App itself does not recognize that there are already some of them

Code snippet

I added/changed this code

    private const int MaxPinsThreshold = 0;
    public async Task PinMonkey(Monkey monkey)
    {
        if (await MaxNumberOfPinsReached())
        {
            **CrossAppShortcuts.Current.RemoveShortcut(monkey.Id);**
            throw new MaxPinnedItemsException();
        ...

and could manage to Unpin all old Items from the List.
But that can not be a solution (especially for users of an app)

Screenshots

I can not add a screenshot, as the popup from the App Icon does disappear once I click on "Take screenshot"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.