在单击fbloginview时允许用户的读取权限后,下面的代码尝试重新授权发布权限.
#pragma mark FBLoginViewDelegate Method
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id<FBGraphUser>)user {
NSLog(@"User info fetched %@ %@", user.name, user.id);
[Global FBUser:user.first_name lastname:user.last_name fid:user.id];
if ([[FBSession activeSession] isOpen])
{
//[[FBSession activeSession] closeAndClearTokenInformation];
[[FBSession activeSession] reauthorizeWithPublishPermissions:[[[NSArray alloc] initWithObjects:@"publish_stream", nil] autorelease]
defaultAudience:FBSessionDefaultAudienceEveryone
completionHandler:^(FBSession* session, NSError* error)
{
if ([delegate respondsToSelector:@selector(SignUpAlertViewWasDone:)])
[delegate SignUpAlertViewWasDone:self];
[self removeFromSuperview];
}
];
}
Run Code Online (Sandbox Code Playgroud)
它给了我这个错误:
exception'com.facebook.sdk:InvalidOperationException',reason:'FBSession:在先前的重新授权呼叫尚未完成时重新授权无效.'
以前的重新授权呼叫完成时是否有可以检测到的功能?
我尝试使用openWithPublishPermission但它不起作用.
我正在使用 RedirectToAction 在登录后加载一个新页面并用它传入数据库模型。
RedirectToAction("AdministrationPortal", "Manage", person);
Run Code Online (Sandbox Code Playgroud)
person.user 模型是实体框架创建的 User 类。人物模型是
class Person {
public User user { get; set; };
public string roleType { get; set; };
}
Run Code Online (Sandbox Code Playgroud)
在调用 RedirectToAction 时,我节点 person 对象确实保存了数据。
不知道为什么当我在门户页面上使用它时@Model.Person.user
为空。
@model namespace.Model.Person
Run Code Online (Sandbox Code Playgroud) 接收InvalidCastException
in LoadApplication(new App());
.我在PCL和Android中添加了SkiaSharp和SkiaSharp.Views.Forms.它还自动将SkiaSharp.Views包添加到Android项目中.
我删除了所有复杂的代码,并将此部分保留在我的XAML文件中
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:skia="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms"
x:Class="SkiaSharpRemote.MediaControlView">
<ContentView.Content>
<!--<skia:SKCanvasView
x:Name="canvas"
VerticalOptions="Fill"
HorizontalOptions="Fill"
PaintSurface="Canvas_PaintSurface">
</skia:SKCanvasView>-->
</ContentView.Content>
</ContentView>
Run Code Online (Sandbox Code Playgroud)
在我注释掉该skCanvasView
行之后加载了该应用.如果我取消注释它,则抛出以下异常.
at(wrapper castclass)System.Object:__ castclass_with_cache(object,intptr,intptr)at Xamarin.Forms.Registrar
1[TRegistrable].GetHandler (System.Type type) [0x0001b] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\Registrar.cs:24 at Xamarin.Forms.Registrar
1 [TRegistrable] .GetHandler [TOut](System.Type type)[0x00000] in C:\ BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\Registrar.cs:29位于C:\ BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform中的Xamarin.Forms.Platform.Android.Platform.CreateRenderer(Xamarin.Forms.VisualElement元素)[0x00006] .Android\Platform.cs:288 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild(Xamarin.Forms.VisualElement view,Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer,Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren)[0x00023]在C:\ BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:74 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement(Xamarin.Forms.VisualElement oldElement) ,Xamarin.Forms.VisualElement newElement)[0x00104]在C:\ BuildAgent2\work\ca3766cfc22354a1\Xamarin中 .Forms.Platform.Android\VisualElementPackager.cs:207,位于C:\ BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementPackager.cs中的Xamarin.Forms.Platform.Android.VisualElementPackager.Load()[0x00000] :58,Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:337 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1 [TElement] .SetElement(TElement element)[0x00111]位于C:\ BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:196 at Xamarin .Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement …
我看了一些答案但与firebase和实时数据不相容或类似相关.我的简单测试应用程序与firebase无关.
这是模块级别的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "room.exercise.com.myapplication"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:recyclerview-v7:27.1.1'
//Design for room persistance storage
implementation 'android.arch.persistence.room:runtime:1.0.0'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
/////
//Design for live data
implementation "android.arch.lifecycle:extensions:1.0.0"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0"
//
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Run Code Online (Sandbox Code Playgroud)
这个应用程序只是对Room和Live数据的一个简单测试,我将数据从数据库加载到recyclerView ..我知道Room数据库正在工作,因为这是我的第一个测试.
gradle文件同步没有问题.编译并运行应用程序时发生错误.
程序类型已存在:android.arch.lifecycle.LiveData $ …
当前正在运行身份服务器 4 并且能够使用 client_credential 流接收访问令牌。
我使用令牌从服务器访问 api 但收到此消息
error="invalid_token", error_description="未找到签名密钥"
我怀疑在调用 Web api 时传递令牌时需要以某种方式验证令牌。
我的设置是这样的。
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(options =>
{
options.Authority = Configuration.GetValue<string>("ApiAuthorityBaseUrl");
options.Audience = "api1";
options.RequireHttpsMetadata = false;
});
Run Code Online (Sandbox Code Playgroud)
并使用 AddDeveloperSigningCredential。
AddJwtBearer 中有一个名为 TokenValidationParameters 的东西,我不确定它是否是解决问题的正确位置。有人可以给我一些提示吗
我正在查看 Microsoft 网站上的 Respository Pattern。
我部分我不明白 IAggregateRoot 做什么?
public interface IRepository<T> where T : IAggregateRoot
{
//....
}
Run Code Online (Sandbox Code Playgroud)
每个存储库类是否可以相互交互,例如 OrderRespository 可以使用 Product 存储库。
我有一个 MasterDetailPage ,该页面被推送到导航:
await MainPage.Navigation.PushAsync(new MasterDevicePage());
Run Code Online (Sandbox Code Playgroud)
当主设备页面加载时,主页面的列表视图将选择其中一个页面并将其显示在详细信息屏幕上。
masterPage.ListView.ItemSelected += (sender, e) =>
{
var item = e.SelectedItem as MasterPageModel;
if (item != null)
{
Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
Detail.Title = item.Title;
masterPage.ListView.SelectedItem = null;
IsPresented = false;
}
};
Run Code Online (Sandbox Code Playgroud)
错误发生在 Detail = new NavigationPage 部分。
找不到 Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) 的构造函数
无法从本机句柄 0x85300019 (key_handle 0x42c360f8) 激活 Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer 类型的实例。
我目前正在使用 FFImageLoading 包进行缓存等以在用户界面上显示。我不确定 FFImageLoading 是否具有调整图像本身大小的功能,以便我可以保存它并通过互联网发送。
我试图过滤掉所有不是图像、视频、音频、pdf 和其他文档文件的文件,例如 microsoft。
目前,我的代码中有这个:
var allowedUTIs = new string[] {
UTType.Image,
UTType.PDF,
UTType.Video,
UTType.Audio,
UTType.Movie,
UTTYPE.Text,
"com.microsoft.word.doc",
"com.microsoft.excel.xls",
"com.microsoft.powerpoint.ppt",
"org.openxmlformats.wordprocessingml.document"
};
Run Code Online (Sandbox Code Playgroud)
主要关注的是自定义定义的类型。它是否涵盖了所有 microsoft office 文件类型:doc、xls、ppt、docx 等...
有没有我没有涵盖的其他文档类型,例如苹果的特定文档文件。
我开始学习react-native和redux。在某些区域,由于复杂性,我可以在某些组件中使用 redux 吗?某些组件只是通过组件中的 setState 和 this.state 在react-native中使用本地状态。
import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
class Blink extends Component {
constructor(props) {
super(props);
this.state = {isShowingText: true};
// Toggle the state every second
setInterval(() => {
this.setState(previousState => {
return { isShowingText: !previousState.isShowingText };
});
}, 1000);
}
render() {
let display = this.state.isShowingText ? this.props.text : ' ';
return (
<Text>{display}</Text>
);
}
}
Run Code Online (Sandbox Code Playgroud) xamarin ×4
access-token ×1
android ×1
asp.net-mvc ×1
c# ×1
contenttype ×1
database ×1
facebook ×1
file-type ×1
identity ×1
image ×1
ios ×1
iphone ×1
linq ×1
loginview ×1
model ×1
navigation ×1
objective-c ×1
react-native ×1
redux ×1
resize ×1
skiasharp ×1